effect
stringclasses
48 values
original_source_type
stringlengths
0
23k
opens_and_abbrevs
listlengths
2
92
isa_cross_project_example
bool
1 class
source_definition
stringlengths
9
57.9k
partial_definition
stringlengths
7
23.3k
is_div
bool
2 classes
is_type
null
is_proof
bool
2 classes
completed_definiton
stringlengths
1
250k
dependencies
dict
effect_flags
sequencelengths
0
2
ideal_premises
sequencelengths
0
236
mutual_with
sequencelengths
0
11
file_context
stringlengths
0
407k
interleaved
bool
1 class
is_simply_typed
bool
2 classes
file_name
stringlengths
5
48
vconfig
dict
is_simple_lemma
null
source_type
stringlengths
10
23k
proof_features
sequencelengths
0
1
name
stringlengths
8
95
source
dict
verbose_type
stringlengths
1
7.42k
source_range
dict
FStar.Pervasives.Lemma
val lognot_plus_one: e:uint16 -> Lemma (v (lognot e) == modulus U16 - v e - 1)
[ { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lognot_plus_one e = lognot_spec e; assert (v (lognot e) == UInt.lognot #16 (v e)); UInt.lemma_lognot_value_mod #16 (v e); assert (v (lognot e) == pow2 16 - v e - 1)
val lognot_plus_one: e:uint16 -> Lemma (v (lognot e) == modulus U16 - v e - 1) let lognot_plus_one e =
false
null
true
lognot_spec e; assert (v (lognot e) == UInt.lognot #16 (v e)); UInt.lemma_lognot_value_mod #16 (v e); assert (v (lognot e) == pow2 16 - v e - 1)
{ "checked_file": "Spec.Frodo.Lemmas.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.IntTypes.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Spec.Frodo.Lemmas.fst" }
[ "lemma" ]
[ "Lib.IntTypes.uint16", "Prims._assert", "Prims.eq2", "Prims.int", "Lib.IntTypes.v", "Lib.IntTypes.U16", "Lib.IntTypes.SEC", "Lib.IntTypes.lognot", "Prims.op_Subtraction", "Prims.pow2", "Prims.unit", "FStar.UInt.lemma_lognot_value_mod", "Prims.l_or", "Lib.IntTypes.range", "FStar.UInt.size", "FStar.UInt.lognot", "Lib.IntTypes.lognot_spec" ]
[]
module Spec.Frodo.Lemmas open FStar.Mul open Lib.IntTypes #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" val lemma_mask_cast: mask:uint16{v mask = 0 \/ v mask = v (ones U16 SEC)} -> Lemma ((v mask = 0 ==> v (to_u8 mask) = 0) /\ (v mask = v (ones U16 SEC) ==> v (to_u8 mask) = v (ones U8 SEC))) let lemma_mask_cast mask = () // To avoid integral promotion, a cast to uint_16 is needed // https://en.cppreference.com/w/cpp/language/operator_arithmetic val lemma_frodo_sample: a:uint16{v a < pow2 15} -> b:uint16{v b < pow2 15} -> Lemma (let c0 = if v a > v b then 1 else 0 in let c1 = to_u16 (to_u32 (b -. a)) >>. 15ul in v c1 == c0) let lemma_frodo_sample a b = let c = to_u16 (to_u32 (b -. a)) in assert (v c < modulus U16); Math.Lemmas.lemma_div_lt (uint_v c) 16 15; let c1 = c >>. 15ul in assert (v c1 = v c / pow2 15); Math.Lemmas.pow2_minus 16 15; assert (v c1 = 0 \/ v c1 = 1) val modulo_pow2_u16: a:uint16 -> b:size_nat{b < 16} -> Lemma (v a % pow2 b == v (a &. ((u16 1 <<. size b) -. u16 1))) let modulo_pow2_u16 a b = Math.Lemmas.pow2_lt_compat 16 b; mod_mask_lemma #U16 a (size b); assert (v (mod_mask #U16 #SEC (size b)) == v ((u16 1 <<. size b) -. u16 1)) val modulo_pow2_u64: a:uint64 -> b:size_nat{b < 64} -> Lemma (v a % pow2 b == v (a &. ((u64 1 <<. size b) -. u64 1))) let modulo_pow2_u64 a b = Math.Lemmas.pow2_lt_compat 64 b; mod_mask_lemma #U64 a (size b); assert (v (mod_mask #U64 #SEC (size b)) == v ((u64 1 <<. size b) -. u64 1)) val lognot_plus_one: e:uint16 -> Lemma (v (lognot e) == modulus U16 - v e - 1)
false
false
Spec.Frodo.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lognot_plus_one: e:uint16 -> Lemma (v (lognot e) == modulus U16 - v e - 1)
[]
Spec.Frodo.Lemmas.lognot_plus_one
{ "file_name": "specs/frodo/Spec.Frodo.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
e: Lib.IntTypes.uint16 -> FStar.Pervasives.Lemma (ensures Lib.IntTypes.v (Lib.IntTypes.lognot e) == Lib.IntTypes.modulus Lib.IntTypes.U16 - Lib.IntTypes.v e - 1)
{ "end_col": 44, "end_line": 58, "start_col": 2, "start_line": 55 }
FStar.Pervasives.Lemma
val lemma_matrix_index_repeati2: n1:size_nat -> n2:size_nat -> i:size_nat{i < n1} -> j:size_nat{j < n2} -> Lemma (2 * (n1 * j + i) + 2 <= 2 * n1 * n2)
[ { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_matrix_index_repeati2 n1 n2 i j = lemma_matrix_index_repeati1 n2 n1 j i
val lemma_matrix_index_repeati2: n1:size_nat -> n2:size_nat -> i:size_nat{i < n1} -> j:size_nat{j < n2} -> Lemma (2 * (n1 * j + i) + 2 <= 2 * n1 * n2) let lemma_matrix_index_repeati2 n1 n2 i j =
false
null
true
lemma_matrix_index_repeati1 n2 n1 j i
{ "checked_file": "Spec.Frodo.Lemmas.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.IntTypes.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Spec.Frodo.Lemmas.fst" }
[ "lemma" ]
[ "Lib.IntTypes.size_nat", "Prims.b2t", "Prims.op_LessThan", "Spec.Frodo.Lemmas.lemma_matrix_index_repeati1", "Prims.unit" ]
[]
module Spec.Frodo.Lemmas open FStar.Mul open Lib.IntTypes #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" val lemma_mask_cast: mask:uint16{v mask = 0 \/ v mask = v (ones U16 SEC)} -> Lemma ((v mask = 0 ==> v (to_u8 mask) = 0) /\ (v mask = v (ones U16 SEC) ==> v (to_u8 mask) = v (ones U8 SEC))) let lemma_mask_cast mask = () // To avoid integral promotion, a cast to uint_16 is needed // https://en.cppreference.com/w/cpp/language/operator_arithmetic val lemma_frodo_sample: a:uint16{v a < pow2 15} -> b:uint16{v b < pow2 15} -> Lemma (let c0 = if v a > v b then 1 else 0 in let c1 = to_u16 (to_u32 (b -. a)) >>. 15ul in v c1 == c0) let lemma_frodo_sample a b = let c = to_u16 (to_u32 (b -. a)) in assert (v c < modulus U16); Math.Lemmas.lemma_div_lt (uint_v c) 16 15; let c1 = c >>. 15ul in assert (v c1 = v c / pow2 15); Math.Lemmas.pow2_minus 16 15; assert (v c1 = 0 \/ v c1 = 1) val modulo_pow2_u16: a:uint16 -> b:size_nat{b < 16} -> Lemma (v a % pow2 b == v (a &. ((u16 1 <<. size b) -. u16 1))) let modulo_pow2_u16 a b = Math.Lemmas.pow2_lt_compat 16 b; mod_mask_lemma #U16 a (size b); assert (v (mod_mask #U16 #SEC (size b)) == v ((u16 1 <<. size b) -. u16 1)) val modulo_pow2_u64: a:uint64 -> b:size_nat{b < 64} -> Lemma (v a % pow2 b == v (a &. ((u64 1 <<. size b) -. u64 1))) let modulo_pow2_u64 a b = Math.Lemmas.pow2_lt_compat 64 b; mod_mask_lemma #U64 a (size b); assert (v (mod_mask #U64 #SEC (size b)) == v ((u64 1 <<. size b) -. u64 1)) val lognot_plus_one: e:uint16 -> Lemma (v (lognot e) == modulus U16 - v e - 1) let lognot_plus_one e = lognot_spec e; assert (v (lognot e) == UInt.lognot #16 (v e)); UInt.lemma_lognot_value_mod #16 (v e); assert (v (lognot e) == pow2 16 - v e - 1) val lemma_frodo_sample2: sign:uint16{v sign <= 1} -> e:uint16 -> Lemma (((lognot sign +. u16 1) ^. e) +. sign == u16 ((Math.Lib.powx (-1) (v sign) * v e) % modulus U16)) let lemma_frodo_sample2 sign e = calc (==) { v ((lognot sign +. u16 1) ^. e); (==) { logxor_spec (lognot sign +. u16 1) e } logxor_v #U16 (v (lognot sign +. u16 1)) (v e); (==) { lognot_plus_one sign } logxor_v #U16 ((modulus U16 - v sign) % modulus U16) (v e); (==) { UInt.logxor_commutative #16 ((modulus U16 - v sign) % modulus U16) (v e) } logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); }; if v sign = 0 then begin calc (==) { logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); (==) { Math.Lemmas.multiple_modulo_lemma 1 (modulus U16) } logxor_v #U16 (v e) 0; (==) { UInt.logxor_lemma_1 #16 (v e) } v e; }; assert (v (((lognot sign +. u16 1) ^. e) +. sign) == v e); assert_norm (Math.Lib.powx (-1) 0 = 1); Math.Lemmas.small_mod (v e) (modulus U16) end else begin calc (==) { logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); (==) { Math.Lemmas.small_mod (modulus U16 - v sign) (modulus U16) } logxor_v #U16 (v e) (UInt.ones 16); (==) { UInt.logxor_lemma_2 #16 (v e) } lognot_v #U16 (v e); (==) { UInt.lemma_lognot_value_mod #16 (v e) } modulus U16 - v e - 1; }; assert (v (((lognot sign +. u16 1) ^. e) +. sign) == (modulus U16 - v e) % modulus U16); assert_norm (Math.Lib.powx (-1) 1 = -1) end val lemma_mul_acc_comm: a:size_nat -> b:size_nat -> c:size_nat -> Lemma (a * b * c = c * a * b) let lemma_mul_acc_comm a b c = () val lemma_matrix_index_repeati1: n1:size_nat -> n2:size_nat -> i:size_nat{i < n1} -> j:size_nat{j < n2} -> Lemma (2 * (i * n2 + j) + 2 <= 2 * n1 * n2) let lemma_matrix_index_repeati1 n1 n2 i j = assert (i * n2 + j <= (n1 - 1) * n2 + (n2 - 1)); calc (<=) { 2 * (i * n2 + j) + 2; <= { Math.Lemmas.lemma_mult_le_right n2 i (n1 - 1) } 2 * ((n1 - 1) * n2 + (n2 - 1)) + 2; == { } 2 * (n1 - 1) * n2 + 2 * n2 - 2 + 2; == { } 2 * n1 * n2; } val lemma_matrix_index_repeati2: n1:size_nat -> n2:size_nat -> i:size_nat{i < n1} -> j:size_nat{j < n2} -> Lemma (2 * (n1 * j + i) + 2 <= 2 * n1 * n2)
false
false
Spec.Frodo.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_matrix_index_repeati2: n1:size_nat -> n2:size_nat -> i:size_nat{i < n1} -> j:size_nat{j < n2} -> Lemma (2 * (n1 * j + i) + 2 <= 2 * n1 * n2)
[]
Spec.Frodo.Lemmas.lemma_matrix_index_repeati2
{ "file_name": "specs/frodo/Spec.Frodo.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
n1: Lib.IntTypes.size_nat -> n2: Lib.IntTypes.size_nat -> i: Lib.IntTypes.size_nat{i < n1} -> j: Lib.IntTypes.size_nat{j < n2} -> FStar.Pervasives.Lemma (ensures 2 * (n1 * j + i) + 2 <= (2 * n1) * n2)
{ "end_col": 39, "end_line": 130, "start_col": 2, "start_line": 130 }
FStar.Pervasives.Lemma
val lemma_matrix_index_repeati1: n1:size_nat -> n2:size_nat -> i:size_nat{i < n1} -> j:size_nat{j < n2} -> Lemma (2 * (i * n2 + j) + 2 <= 2 * n1 * n2)
[ { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_matrix_index_repeati1 n1 n2 i j = assert (i * n2 + j <= (n1 - 1) * n2 + (n2 - 1)); calc (<=) { 2 * (i * n2 + j) + 2; <= { Math.Lemmas.lemma_mult_le_right n2 i (n1 - 1) } 2 * ((n1 - 1) * n2 + (n2 - 1)) + 2; == { } 2 * (n1 - 1) * n2 + 2 * n2 - 2 + 2; == { } 2 * n1 * n2; }
val lemma_matrix_index_repeati1: n1:size_nat -> n2:size_nat -> i:size_nat{i < n1} -> j:size_nat{j < n2} -> Lemma (2 * (i * n2 + j) + 2 <= 2 * n1 * n2) let lemma_matrix_index_repeati1 n1 n2 i j =
false
null
true
assert (i * n2 + j <= (n1 - 1) * n2 + (n2 - 1)); calc ( <= ) { 2 * (i * n2 + j) + 2; ( <= ) { Math.Lemmas.lemma_mult_le_right n2 i (n1 - 1) } 2 * ((n1 - 1) * n2 + (n2 - 1)) + 2; ( == ) { () } (2 * (n1 - 1)) * n2 + 2 * n2 - 2 + 2; ( == ) { () } (2 * n1) * n2; }
{ "checked_file": "Spec.Frodo.Lemmas.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.IntTypes.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Spec.Frodo.Lemmas.fst" }
[ "lemma" ]
[ "Lib.IntTypes.size_nat", "Prims.b2t", "Prims.op_LessThan", "FStar.Calc.calc_finish", "Prims.int", "Prims.op_LessThanOrEqual", "Prims.op_Addition", "FStar.Mul.op_Star", "Prims.Cons", "FStar.Preorder.relation", "Prims.eq2", "Prims.Nil", "Prims.unit", "FStar.Calc.calc_step", "Prims.op_Subtraction", "FStar.Calc.calc_init", "FStar.Calc.calc_pack", "FStar.Math.Lemmas.lemma_mult_le_right", "Prims.squash", "Prims._assert" ]
[]
module Spec.Frodo.Lemmas open FStar.Mul open Lib.IntTypes #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" val lemma_mask_cast: mask:uint16{v mask = 0 \/ v mask = v (ones U16 SEC)} -> Lemma ((v mask = 0 ==> v (to_u8 mask) = 0) /\ (v mask = v (ones U16 SEC) ==> v (to_u8 mask) = v (ones U8 SEC))) let lemma_mask_cast mask = () // To avoid integral promotion, a cast to uint_16 is needed // https://en.cppreference.com/w/cpp/language/operator_arithmetic val lemma_frodo_sample: a:uint16{v a < pow2 15} -> b:uint16{v b < pow2 15} -> Lemma (let c0 = if v a > v b then 1 else 0 in let c1 = to_u16 (to_u32 (b -. a)) >>. 15ul in v c1 == c0) let lemma_frodo_sample a b = let c = to_u16 (to_u32 (b -. a)) in assert (v c < modulus U16); Math.Lemmas.lemma_div_lt (uint_v c) 16 15; let c1 = c >>. 15ul in assert (v c1 = v c / pow2 15); Math.Lemmas.pow2_minus 16 15; assert (v c1 = 0 \/ v c1 = 1) val modulo_pow2_u16: a:uint16 -> b:size_nat{b < 16} -> Lemma (v a % pow2 b == v (a &. ((u16 1 <<. size b) -. u16 1))) let modulo_pow2_u16 a b = Math.Lemmas.pow2_lt_compat 16 b; mod_mask_lemma #U16 a (size b); assert (v (mod_mask #U16 #SEC (size b)) == v ((u16 1 <<. size b) -. u16 1)) val modulo_pow2_u64: a:uint64 -> b:size_nat{b < 64} -> Lemma (v a % pow2 b == v (a &. ((u64 1 <<. size b) -. u64 1))) let modulo_pow2_u64 a b = Math.Lemmas.pow2_lt_compat 64 b; mod_mask_lemma #U64 a (size b); assert (v (mod_mask #U64 #SEC (size b)) == v ((u64 1 <<. size b) -. u64 1)) val lognot_plus_one: e:uint16 -> Lemma (v (lognot e) == modulus U16 - v e - 1) let lognot_plus_one e = lognot_spec e; assert (v (lognot e) == UInt.lognot #16 (v e)); UInt.lemma_lognot_value_mod #16 (v e); assert (v (lognot e) == pow2 16 - v e - 1) val lemma_frodo_sample2: sign:uint16{v sign <= 1} -> e:uint16 -> Lemma (((lognot sign +. u16 1) ^. e) +. sign == u16 ((Math.Lib.powx (-1) (v sign) * v e) % modulus U16)) let lemma_frodo_sample2 sign e = calc (==) { v ((lognot sign +. u16 1) ^. e); (==) { logxor_spec (lognot sign +. u16 1) e } logxor_v #U16 (v (lognot sign +. u16 1)) (v e); (==) { lognot_plus_one sign } logxor_v #U16 ((modulus U16 - v sign) % modulus U16) (v e); (==) { UInt.logxor_commutative #16 ((modulus U16 - v sign) % modulus U16) (v e) } logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); }; if v sign = 0 then begin calc (==) { logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); (==) { Math.Lemmas.multiple_modulo_lemma 1 (modulus U16) } logxor_v #U16 (v e) 0; (==) { UInt.logxor_lemma_1 #16 (v e) } v e; }; assert (v (((lognot sign +. u16 1) ^. e) +. sign) == v e); assert_norm (Math.Lib.powx (-1) 0 = 1); Math.Lemmas.small_mod (v e) (modulus U16) end else begin calc (==) { logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); (==) { Math.Lemmas.small_mod (modulus U16 - v sign) (modulus U16) } logxor_v #U16 (v e) (UInt.ones 16); (==) { UInt.logxor_lemma_2 #16 (v e) } lognot_v #U16 (v e); (==) { UInt.lemma_lognot_value_mod #16 (v e) } modulus U16 - v e - 1; }; assert (v (((lognot sign +. u16 1) ^. e) +. sign) == (modulus U16 - v e) % modulus U16); assert_norm (Math.Lib.powx (-1) 1 = -1) end val lemma_mul_acc_comm: a:size_nat -> b:size_nat -> c:size_nat -> Lemma (a * b * c = c * a * b) let lemma_mul_acc_comm a b c = () val lemma_matrix_index_repeati1: n1:size_nat -> n2:size_nat -> i:size_nat{i < n1} -> j:size_nat{j < n2} -> Lemma (2 * (i * n2 + j) + 2 <= 2 * n1 * n2)
false
false
Spec.Frodo.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_matrix_index_repeati1: n1:size_nat -> n2:size_nat -> i:size_nat{i < n1} -> j:size_nat{j < n2} -> Lemma (2 * (i * n2 + j) + 2 <= 2 * n1 * n2)
[]
Spec.Frodo.Lemmas.lemma_matrix_index_repeati1
{ "file_name": "specs/frodo/Spec.Frodo.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
n1: Lib.IntTypes.size_nat -> n2: Lib.IntTypes.size_nat -> i: Lib.IntTypes.size_nat{i < n1} -> j: Lib.IntTypes.size_nat{j < n2} -> FStar.Pervasives.Lemma (ensures 2 * (i * n2 + j) + 2 <= (2 * n1) * n2)
{ "end_col": 3, "end_line": 122, "start_col": 2, "start_line": 113 }
FStar.Pervasives.Lemma
val modulo_pow2_u16: a:uint16 -> b:size_nat{b < 16} -> Lemma (v a % pow2 b == v (a &. ((u16 1 <<. size b) -. u16 1)))
[ { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modulo_pow2_u16 a b = Math.Lemmas.pow2_lt_compat 16 b; mod_mask_lemma #U16 a (size b); assert (v (mod_mask #U16 #SEC (size b)) == v ((u16 1 <<. size b) -. u16 1))
val modulo_pow2_u16: a:uint16 -> b:size_nat{b < 16} -> Lemma (v a % pow2 b == v (a &. ((u16 1 <<. size b) -. u16 1))) let modulo_pow2_u16 a b =
false
null
true
Math.Lemmas.pow2_lt_compat 16 b; mod_mask_lemma #U16 a (size b); assert (v (mod_mask #U16 #SEC (size b)) == v ((u16 1 <<. size b) -. u16 1))
{ "checked_file": "Spec.Frodo.Lemmas.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.IntTypes.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Spec.Frodo.Lemmas.fst" }
[ "lemma" ]
[ "Lib.IntTypes.uint16", "Lib.IntTypes.size_nat", "Prims.b2t", "Prims.op_LessThan", "Prims._assert", "Prims.eq2", "Lib.IntTypes.range_t", "Lib.IntTypes.U16", "Lib.IntTypes.v", "Lib.IntTypes.SEC", "Lib.IntTypes.mod_mask", "Lib.IntTypes.size", "Lib.IntTypes.op_Subtraction_Dot", "Lib.IntTypes.op_Less_Less_Dot", "Lib.IntTypes.u16", "Prims.unit", "Lib.IntTypes.mod_mask_lemma", "FStar.Math.Lemmas.pow2_lt_compat" ]
[]
module Spec.Frodo.Lemmas open FStar.Mul open Lib.IntTypes #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" val lemma_mask_cast: mask:uint16{v mask = 0 \/ v mask = v (ones U16 SEC)} -> Lemma ((v mask = 0 ==> v (to_u8 mask) = 0) /\ (v mask = v (ones U16 SEC) ==> v (to_u8 mask) = v (ones U8 SEC))) let lemma_mask_cast mask = () // To avoid integral promotion, a cast to uint_16 is needed // https://en.cppreference.com/w/cpp/language/operator_arithmetic val lemma_frodo_sample: a:uint16{v a < pow2 15} -> b:uint16{v b < pow2 15} -> Lemma (let c0 = if v a > v b then 1 else 0 in let c1 = to_u16 (to_u32 (b -. a)) >>. 15ul in v c1 == c0) let lemma_frodo_sample a b = let c = to_u16 (to_u32 (b -. a)) in assert (v c < modulus U16); Math.Lemmas.lemma_div_lt (uint_v c) 16 15; let c1 = c >>. 15ul in assert (v c1 = v c / pow2 15); Math.Lemmas.pow2_minus 16 15; assert (v c1 = 0 \/ v c1 = 1) val modulo_pow2_u16: a:uint16 -> b:size_nat{b < 16} -> Lemma (v a % pow2 b == v (a &. ((u16 1 <<. size b) -. u16 1)))
false
false
Spec.Frodo.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modulo_pow2_u16: a:uint16 -> b:size_nat{b < 16} -> Lemma (v a % pow2 b == v (a &. ((u16 1 <<. size b) -. u16 1)))
[]
Spec.Frodo.Lemmas.modulo_pow2_u16
{ "file_name": "specs/frodo/Spec.Frodo.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
a: Lib.IntTypes.uint16 -> b: Lib.IntTypes.size_nat{b < 16} -> FStar.Pervasives.Lemma (ensures Lib.IntTypes.v a % Prims.pow2 b == Lib.IntTypes.v (a &. (Lib.IntTypes.u16 1 <<. Lib.IntTypes.size b) -. Lib.IntTypes.u16 1))
{ "end_col": 77, "end_line": 40, "start_col": 2, "start_line": 38 }
FStar.Pervasives.Lemma
val modulo_pow2_u64: a:uint64 -> b:size_nat{b < 64} -> Lemma (v a % pow2 b == v (a &. ((u64 1 <<. size b) -. u64 1)))
[ { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modulo_pow2_u64 a b = Math.Lemmas.pow2_lt_compat 64 b; mod_mask_lemma #U64 a (size b); assert (v (mod_mask #U64 #SEC (size b)) == v ((u64 1 <<. size b) -. u64 1))
val modulo_pow2_u64: a:uint64 -> b:size_nat{b < 64} -> Lemma (v a % pow2 b == v (a &. ((u64 1 <<. size b) -. u64 1))) let modulo_pow2_u64 a b =
false
null
true
Math.Lemmas.pow2_lt_compat 64 b; mod_mask_lemma #U64 a (size b); assert (v (mod_mask #U64 #SEC (size b)) == v ((u64 1 <<. size b) -. u64 1))
{ "checked_file": "Spec.Frodo.Lemmas.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.IntTypes.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Spec.Frodo.Lemmas.fst" }
[ "lemma" ]
[ "Lib.IntTypes.uint64", "Lib.IntTypes.size_nat", "Prims.b2t", "Prims.op_LessThan", "Prims._assert", "Prims.eq2", "Lib.IntTypes.range_t", "Lib.IntTypes.U64", "Lib.IntTypes.v", "Lib.IntTypes.SEC", "Lib.IntTypes.mod_mask", "Lib.IntTypes.size", "Lib.IntTypes.op_Subtraction_Dot", "Lib.IntTypes.op_Less_Less_Dot", "Lib.IntTypes.u64", "Prims.unit", "Lib.IntTypes.mod_mask_lemma", "FStar.Math.Lemmas.pow2_lt_compat" ]
[]
module Spec.Frodo.Lemmas open FStar.Mul open Lib.IntTypes #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" val lemma_mask_cast: mask:uint16{v mask = 0 \/ v mask = v (ones U16 SEC)} -> Lemma ((v mask = 0 ==> v (to_u8 mask) = 0) /\ (v mask = v (ones U16 SEC) ==> v (to_u8 mask) = v (ones U8 SEC))) let lemma_mask_cast mask = () // To avoid integral promotion, a cast to uint_16 is needed // https://en.cppreference.com/w/cpp/language/operator_arithmetic val lemma_frodo_sample: a:uint16{v a < pow2 15} -> b:uint16{v b < pow2 15} -> Lemma (let c0 = if v a > v b then 1 else 0 in let c1 = to_u16 (to_u32 (b -. a)) >>. 15ul in v c1 == c0) let lemma_frodo_sample a b = let c = to_u16 (to_u32 (b -. a)) in assert (v c < modulus U16); Math.Lemmas.lemma_div_lt (uint_v c) 16 15; let c1 = c >>. 15ul in assert (v c1 = v c / pow2 15); Math.Lemmas.pow2_minus 16 15; assert (v c1 = 0 \/ v c1 = 1) val modulo_pow2_u16: a:uint16 -> b:size_nat{b < 16} -> Lemma (v a % pow2 b == v (a &. ((u16 1 <<. size b) -. u16 1))) let modulo_pow2_u16 a b = Math.Lemmas.pow2_lt_compat 16 b; mod_mask_lemma #U16 a (size b); assert (v (mod_mask #U16 #SEC (size b)) == v ((u16 1 <<. size b) -. u16 1)) val modulo_pow2_u64: a:uint64 -> b:size_nat{b < 64} -> Lemma (v a % pow2 b == v (a &. ((u64 1 <<. size b) -. u64 1)))
false
false
Spec.Frodo.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modulo_pow2_u64: a:uint64 -> b:size_nat{b < 64} -> Lemma (v a % pow2 b == v (a &. ((u64 1 <<. size b) -. u64 1)))
[]
Spec.Frodo.Lemmas.modulo_pow2_u64
{ "file_name": "specs/frodo/Spec.Frodo.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
a: Lib.IntTypes.uint64 -> b: Lib.IntTypes.size_nat{b < 64} -> FStar.Pervasives.Lemma (ensures Lib.IntTypes.v a % Prims.pow2 b == Lib.IntTypes.v (a &. (Lib.IntTypes.u64 1 <<. Lib.IntTypes.size b) -. Lib.IntTypes.u64 1))
{ "end_col": 77, "end_line": 49, "start_col": 2, "start_line": 47 }
FStar.Pervasives.Lemma
val lemma_frodo_sample: a:uint16{v a < pow2 15} -> b:uint16{v b < pow2 15} -> Lemma (let c0 = if v a > v b then 1 else 0 in let c1 = to_u16 (to_u32 (b -. a)) >>. 15ul in v c1 == c0)
[ { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_frodo_sample a b = let c = to_u16 (to_u32 (b -. a)) in assert (v c < modulus U16); Math.Lemmas.lemma_div_lt (uint_v c) 16 15; let c1 = c >>. 15ul in assert (v c1 = v c / pow2 15); Math.Lemmas.pow2_minus 16 15; assert (v c1 = 0 \/ v c1 = 1)
val lemma_frodo_sample: a:uint16{v a < pow2 15} -> b:uint16{v b < pow2 15} -> Lemma (let c0 = if v a > v b then 1 else 0 in let c1 = to_u16 (to_u32 (b -. a)) >>. 15ul in v c1 == c0) let lemma_frodo_sample a b =
false
null
true
let c = to_u16 (to_u32 (b -. a)) in assert (v c < modulus U16); Math.Lemmas.lemma_div_lt (uint_v c) 16 15; let c1 = c >>. 15ul in assert (v c1 = v c / pow2 15); Math.Lemmas.pow2_minus 16 15; assert (v c1 = 0 \/ v c1 = 1)
{ "checked_file": "Spec.Frodo.Lemmas.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.IntTypes.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Spec.Frodo.Lemmas.fst" }
[ "lemma" ]
[ "Lib.IntTypes.uint16", "Prims.b2t", "Prims.op_LessThan", "Lib.IntTypes.v", "Lib.IntTypes.U16", "Lib.IntTypes.SEC", "Prims.pow2", "Prims._assert", "Prims.l_or", "Prims.op_Equality", "Prims.int", "Prims.unit", "FStar.Math.Lemmas.pow2_minus", "Prims.op_Division", "Lib.IntTypes.int_t", "Lib.IntTypes.op_Greater_Greater_Dot", "FStar.UInt32.__uint_to_t", "FStar.Math.Lemmas.lemma_div_lt", "Lib.IntTypes.uint_v", "Lib.IntTypes.modulus", "Lib.IntTypes.to_u16", "Lib.IntTypes.U32", "Lib.IntTypes.to_u32", "Lib.IntTypes.op_Subtraction_Dot" ]
[]
module Spec.Frodo.Lemmas open FStar.Mul open Lib.IntTypes #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" val lemma_mask_cast: mask:uint16{v mask = 0 \/ v mask = v (ones U16 SEC)} -> Lemma ((v mask = 0 ==> v (to_u8 mask) = 0) /\ (v mask = v (ones U16 SEC) ==> v (to_u8 mask) = v (ones U8 SEC))) let lemma_mask_cast mask = () // To avoid integral promotion, a cast to uint_16 is needed // https://en.cppreference.com/w/cpp/language/operator_arithmetic val lemma_frodo_sample: a:uint16{v a < pow2 15} -> b:uint16{v b < pow2 15} -> Lemma (let c0 = if v a > v b then 1 else 0 in let c1 = to_u16 (to_u32 (b -. a)) >>. 15ul in v c1 == c0)
false
false
Spec.Frodo.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_frodo_sample: a:uint16{v a < pow2 15} -> b:uint16{v b < pow2 15} -> Lemma (let c0 = if v a > v b then 1 else 0 in let c1 = to_u16 (to_u32 (b -. a)) >>. 15ul in v c1 == c0)
[]
Spec.Frodo.Lemmas.lemma_frodo_sample
{ "file_name": "specs/frodo/Spec.Frodo.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
a: Lib.IntTypes.uint16{Lib.IntTypes.v a < Prims.pow2 15} -> b: Lib.IntTypes.uint16{Lib.IntTypes.v b < Prims.pow2 15} -> FStar.Pervasives.Lemma (ensures (let c0 = (match Lib.IntTypes.v a > Lib.IntTypes.v b with | true -> 1 | _ -> 0) <: Prims.int in let c1 = Lib.IntTypes.to_u16 (Lib.IntTypes.to_u32 (b -. a)) >>. 15ul in Lib.IntTypes.v c1 == c0))
{ "end_col": 31, "end_line": 31, "start_col": 28, "start_line": 24 }
FStar.Pervasives.Lemma
val lemma_matrix_index_repeati: n1:size_nat -> n2:size_nat{n1 * n2 <= max_size_t /\ n2 % 8 = 0} -> d:size_nat{d * n1 <= max_size_t /\ d * n1 * n2 / 8 <= max_size_t} -> i:size_nat{i < n1} -> j:size_nat{j < n2 / 8} -> Lemma (i * (n2 / 8) <= max_size_t /\ i * (n2 / 8) + j <= max_size_t /\ (i * (n2 / 8) + j) * d <= max_size_t /\ (i * (n2 / 8) + j) * d + d <= d * n1 * n2 / 8)
[ { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_matrix_index_repeati n1 n2 d i j = calc (<=) { i * (n2 / 8) + j; <= { } (n1 - 1) * (n2 / 8) + j; <= { } (n1 - 1) * (n2 / 8) + (n2 / 8 - 1); }; Math.Lemmas.lemma_mult_le_right d (i * (n2 / 8) + j) (n1 * (n2 / 8) - 1)
val lemma_matrix_index_repeati: n1:size_nat -> n2:size_nat{n1 * n2 <= max_size_t /\ n2 % 8 = 0} -> d:size_nat{d * n1 <= max_size_t /\ d * n1 * n2 / 8 <= max_size_t} -> i:size_nat{i < n1} -> j:size_nat{j < n2 / 8} -> Lemma (i * (n2 / 8) <= max_size_t /\ i * (n2 / 8) + j <= max_size_t /\ (i * (n2 / 8) + j) * d <= max_size_t /\ (i * (n2 / 8) + j) * d + d <= d * n1 * n2 / 8) let lemma_matrix_index_repeati n1 n2 d i j =
false
null
true
calc ( <= ) { i * (n2 / 8) + j; ( <= ) { () } (n1 - 1) * (n2 / 8) + j; ( <= ) { () } (n1 - 1) * (n2 / 8) + (n2 / 8 - 1); }; Math.Lemmas.lemma_mult_le_right d (i * (n2 / 8) + j) (n1 * (n2 / 8) - 1)
{ "checked_file": "Spec.Frodo.Lemmas.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.IntTypes.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Spec.Frodo.Lemmas.fst" }
[ "lemma" ]
[ "Lib.IntTypes.size_nat", "Prims.l_and", "Prims.b2t", "Prims.op_LessThanOrEqual", "FStar.Mul.op_Star", "Lib.IntTypes.max_size_t", "Prims.op_Equality", "Prims.int", "Prims.op_Modulus", "Prims.op_Division", "Prims.op_LessThan", "FStar.Math.Lemmas.lemma_mult_le_right", "Prims.op_Addition", "Prims.op_Subtraction", "Prims.unit", "FStar.Calc.calc_finish", "Prims.Cons", "FStar.Preorder.relation", "Prims.Nil", "FStar.Calc.calc_step", "FStar.Calc.calc_init", "FStar.Calc.calc_pack", "Prims.squash" ]
[]
module Spec.Frodo.Lemmas open FStar.Mul open Lib.IntTypes #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" val lemma_mask_cast: mask:uint16{v mask = 0 \/ v mask = v (ones U16 SEC)} -> Lemma ((v mask = 0 ==> v (to_u8 mask) = 0) /\ (v mask = v (ones U16 SEC) ==> v (to_u8 mask) = v (ones U8 SEC))) let lemma_mask_cast mask = () // To avoid integral promotion, a cast to uint_16 is needed // https://en.cppreference.com/w/cpp/language/operator_arithmetic val lemma_frodo_sample: a:uint16{v a < pow2 15} -> b:uint16{v b < pow2 15} -> Lemma (let c0 = if v a > v b then 1 else 0 in let c1 = to_u16 (to_u32 (b -. a)) >>. 15ul in v c1 == c0) let lemma_frodo_sample a b = let c = to_u16 (to_u32 (b -. a)) in assert (v c < modulus U16); Math.Lemmas.lemma_div_lt (uint_v c) 16 15; let c1 = c >>. 15ul in assert (v c1 = v c / pow2 15); Math.Lemmas.pow2_minus 16 15; assert (v c1 = 0 \/ v c1 = 1) val modulo_pow2_u16: a:uint16 -> b:size_nat{b < 16} -> Lemma (v a % pow2 b == v (a &. ((u16 1 <<. size b) -. u16 1))) let modulo_pow2_u16 a b = Math.Lemmas.pow2_lt_compat 16 b; mod_mask_lemma #U16 a (size b); assert (v (mod_mask #U16 #SEC (size b)) == v ((u16 1 <<. size b) -. u16 1)) val modulo_pow2_u64: a:uint64 -> b:size_nat{b < 64} -> Lemma (v a % pow2 b == v (a &. ((u64 1 <<. size b) -. u64 1))) let modulo_pow2_u64 a b = Math.Lemmas.pow2_lt_compat 64 b; mod_mask_lemma #U64 a (size b); assert (v (mod_mask #U64 #SEC (size b)) == v ((u64 1 <<. size b) -. u64 1)) val lognot_plus_one: e:uint16 -> Lemma (v (lognot e) == modulus U16 - v e - 1) let lognot_plus_one e = lognot_spec e; assert (v (lognot e) == UInt.lognot #16 (v e)); UInt.lemma_lognot_value_mod #16 (v e); assert (v (lognot e) == pow2 16 - v e - 1) val lemma_frodo_sample2: sign:uint16{v sign <= 1} -> e:uint16 -> Lemma (((lognot sign +. u16 1) ^. e) +. sign == u16 ((Math.Lib.powx (-1) (v sign) * v e) % modulus U16)) let lemma_frodo_sample2 sign e = calc (==) { v ((lognot sign +. u16 1) ^. e); (==) { logxor_spec (lognot sign +. u16 1) e } logxor_v #U16 (v (lognot sign +. u16 1)) (v e); (==) { lognot_plus_one sign } logxor_v #U16 ((modulus U16 - v sign) % modulus U16) (v e); (==) { UInt.logxor_commutative #16 ((modulus U16 - v sign) % modulus U16) (v e) } logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); }; if v sign = 0 then begin calc (==) { logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); (==) { Math.Lemmas.multiple_modulo_lemma 1 (modulus U16) } logxor_v #U16 (v e) 0; (==) { UInt.logxor_lemma_1 #16 (v e) } v e; }; assert (v (((lognot sign +. u16 1) ^. e) +. sign) == v e); assert_norm (Math.Lib.powx (-1) 0 = 1); Math.Lemmas.small_mod (v e) (modulus U16) end else begin calc (==) { logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); (==) { Math.Lemmas.small_mod (modulus U16 - v sign) (modulus U16) } logxor_v #U16 (v e) (UInt.ones 16); (==) { UInt.logxor_lemma_2 #16 (v e) } lognot_v #U16 (v e); (==) { UInt.lemma_lognot_value_mod #16 (v e) } modulus U16 - v e - 1; }; assert (v (((lognot sign +. u16 1) ^. e) +. sign) == (modulus U16 - v e) % modulus U16); assert_norm (Math.Lib.powx (-1) 1 = -1) end val lemma_mul_acc_comm: a:size_nat -> b:size_nat -> c:size_nat -> Lemma (a * b * c = c * a * b) let lemma_mul_acc_comm a b c = () val lemma_matrix_index_repeati1: n1:size_nat -> n2:size_nat -> i:size_nat{i < n1} -> j:size_nat{j < n2} -> Lemma (2 * (i * n2 + j) + 2 <= 2 * n1 * n2) let lemma_matrix_index_repeati1 n1 n2 i j = assert (i * n2 + j <= (n1 - 1) * n2 + (n2 - 1)); calc (<=) { 2 * (i * n2 + j) + 2; <= { Math.Lemmas.lemma_mult_le_right n2 i (n1 - 1) } 2 * ((n1 - 1) * n2 + (n2 - 1)) + 2; == { } 2 * (n1 - 1) * n2 + 2 * n2 - 2 + 2; == { } 2 * n1 * n2; } val lemma_matrix_index_repeati2: n1:size_nat -> n2:size_nat -> i:size_nat{i < n1} -> j:size_nat{j < n2} -> Lemma (2 * (n1 * j + i) + 2 <= 2 * n1 * n2) let lemma_matrix_index_repeati2 n1 n2 i j = lemma_matrix_index_repeati1 n2 n1 j i val lemma_matrix_index_repeati: n1:size_nat -> n2:size_nat{n1 * n2 <= max_size_t /\ n2 % 8 = 0} -> d:size_nat{d * n1 <= max_size_t /\ d * n1 * n2 / 8 <= max_size_t} -> i:size_nat{i < n1} -> j:size_nat{j < n2 / 8} -> Lemma (i * (n2 / 8) <= max_size_t /\ i * (n2 / 8) + j <= max_size_t /\ (i * (n2 / 8) + j) * d <= max_size_t /\ (i * (n2 / 8) + j) * d + d <= d * n1 * n2 / 8)
false
false
Spec.Frodo.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_matrix_index_repeati: n1:size_nat -> n2:size_nat{n1 * n2 <= max_size_t /\ n2 % 8 = 0} -> d:size_nat{d * n1 <= max_size_t /\ d * n1 * n2 / 8 <= max_size_t} -> i:size_nat{i < n1} -> j:size_nat{j < n2 / 8} -> Lemma (i * (n2 / 8) <= max_size_t /\ i * (n2 / 8) + j <= max_size_t /\ (i * (n2 / 8) + j) * d <= max_size_t /\ (i * (n2 / 8) + j) * d + d <= d * n1 * n2 / 8)
[]
Spec.Frodo.Lemmas.lemma_matrix_index_repeati
{ "file_name": "specs/frodo/Spec.Frodo.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
n1: Lib.IntTypes.size_nat -> n2: Lib.IntTypes.size_nat{n1 * n2 <= Lib.IntTypes.max_size_t /\ n2 % 8 = 0} -> d: Lib.IntTypes.size_nat {d * n1 <= Lib.IntTypes.max_size_t /\ (d * n1) * n2 / 8 <= Lib.IntTypes.max_size_t} -> i: Lib.IntTypes.size_nat{i < n1} -> j: Lib.IntTypes.size_nat{j < n2 / 8} -> FStar.Pervasives.Lemma (ensures i * (n2 / 8) <= Lib.IntTypes.max_size_t /\ i * (n2 / 8) + j <= Lib.IntTypes.max_size_t /\ (i * (n2 / 8) + j) * d <= Lib.IntTypes.max_size_t /\ (i * (n2 / 8) + j) * d + d <= (d * n1) * n2 / 8)
{ "end_col": 74, "end_line": 152, "start_col": 2, "start_line": 145 }
FStar.Pervasives.Lemma
val lemma_frodo_sample2: sign:uint16{v sign <= 1} -> e:uint16 -> Lemma (((lognot sign +. u16 1) ^. e) +. sign == u16 ((Math.Lib.powx (-1) (v sign) * v e) % modulus U16))
[ { "abbrev": false, "full_module": "Lib.IntTypes", "short_module": null }, { "abbrev": false, "full_module": "FStar.Mul", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "Spec.Frodo", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let lemma_frodo_sample2 sign e = calc (==) { v ((lognot sign +. u16 1) ^. e); (==) { logxor_spec (lognot sign +. u16 1) e } logxor_v #U16 (v (lognot sign +. u16 1)) (v e); (==) { lognot_plus_one sign } logxor_v #U16 ((modulus U16 - v sign) % modulus U16) (v e); (==) { UInt.logxor_commutative #16 ((modulus U16 - v sign) % modulus U16) (v e) } logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); }; if v sign = 0 then begin calc (==) { logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); (==) { Math.Lemmas.multiple_modulo_lemma 1 (modulus U16) } logxor_v #U16 (v e) 0; (==) { UInt.logxor_lemma_1 #16 (v e) } v e; }; assert (v (((lognot sign +. u16 1) ^. e) +. sign) == v e); assert_norm (Math.Lib.powx (-1) 0 = 1); Math.Lemmas.small_mod (v e) (modulus U16) end else begin calc (==) { logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); (==) { Math.Lemmas.small_mod (modulus U16 - v sign) (modulus U16) } logxor_v #U16 (v e) (UInt.ones 16); (==) { UInt.logxor_lemma_2 #16 (v e) } lognot_v #U16 (v e); (==) { UInt.lemma_lognot_value_mod #16 (v e) } modulus U16 - v e - 1; }; assert (v (((lognot sign +. u16 1) ^. e) +. sign) == (modulus U16 - v e) % modulus U16); assert_norm (Math.Lib.powx (-1) 1 = -1) end
val lemma_frodo_sample2: sign:uint16{v sign <= 1} -> e:uint16 -> Lemma (((lognot sign +. u16 1) ^. e) +. sign == u16 ((Math.Lib.powx (-1) (v sign) * v e) % modulus U16)) let lemma_frodo_sample2 sign e =
false
null
true
calc ( == ) { v ((lognot sign +. u16 1) ^. e); ( == ) { logxor_spec (lognot sign +. u16 1) e } logxor_v #U16 (v (lognot sign +. u16 1)) (v e); ( == ) { lognot_plus_one sign } logxor_v #U16 ((modulus U16 - v sign) % modulus U16) (v e); ( == ) { UInt.logxor_commutative #16 ((modulus U16 - v sign) % modulus U16) (v e) } logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); }; if v sign = 0 then (calc ( == ) { logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); ( == ) { Math.Lemmas.multiple_modulo_lemma 1 (modulus U16) } logxor_v #U16 (v e) 0; ( == ) { UInt.logxor_lemma_1 #16 (v e) } v e; }; assert (v (((lognot sign +. u16 1) ^. e) +. sign) == v e); assert_norm (Math.Lib.powx (- 1) 0 = 1); Math.Lemmas.small_mod (v e) (modulus U16)) else (calc ( == ) { logxor_v #U16 (v e) ((modulus U16 - v sign) % modulus U16); ( == ) { Math.Lemmas.small_mod (modulus U16 - v sign) (modulus U16) } logxor_v #U16 (v e) (UInt.ones 16); ( == ) { UInt.logxor_lemma_2 #16 (v e) } lognot_v #U16 (v e); ( == ) { UInt.lemma_lognot_value_mod #16 (v e) } modulus U16 - v e - 1; }; assert (v (((lognot sign +. u16 1) ^. e) +. sign) == (modulus U16 - v e) % modulus U16); assert_norm (Math.Lib.powx (- 1) 1 = - 1))
{ "checked_file": "Spec.Frodo.Lemmas.fst.checked", "dependencies": [ "prims.fst.checked", "Lib.IntTypes.fsti.checked", "FStar.UInt32.fsti.checked", "FStar.UInt.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.Mul.fst.checked", "FStar.Math.Lib.fst.checked", "FStar.Math.Lemmas.fst.checked", "FStar.Calc.fsti.checked" ], "interface_file": false, "source_file": "Spec.Frodo.Lemmas.fst" }
[ "lemma" ]
[ "Lib.IntTypes.uint16", "Prims.b2t", "Prims.op_LessThanOrEqual", "Lib.IntTypes.v", "Lib.IntTypes.U16", "Lib.IntTypes.SEC", "Prims.op_Equality", "Prims.int", "FStar.Math.Lemmas.small_mod", "Lib.IntTypes.modulus", "Prims.unit", "FStar.Pervasives.assert_norm", "FStar.Math.Lib.powx", "Prims.op_Minus", "Prims._assert", "Prims.eq2", "Lib.IntTypes.range_t", "Lib.IntTypes.op_Plus_Dot", "Lib.IntTypes.op_Hat_Dot", "Lib.IntTypes.lognot", "Lib.IntTypes.u16", "FStar.Calc.calc_finish", "Lib.IntTypes.logxor_v", "Prims.op_Modulus", "Prims.op_Subtraction", "Prims.Cons", "FStar.Preorder.relation", "Prims.Nil", "FStar.Calc.calc_step", "FStar.Calc.calc_init", "FStar.Calc.calc_pack", "FStar.Math.Lemmas.multiple_modulo_lemma", "Prims.squash", "FStar.UInt.logxor_lemma_1", "Prims.bool", "Lib.IntTypes.lognot_v", "FStar.UInt.ones", "FStar.UInt.logxor_lemma_2", "FStar.UInt.lemma_lognot_value_mod", "Lib.IntTypes.logxor_spec", "Spec.Frodo.Lemmas.lognot_plus_one", "FStar.UInt.logxor_commutative" ]
[]
module Spec.Frodo.Lemmas open FStar.Mul open Lib.IntTypes #set-options "--z3rlimit 50 --fuel 0 --ifuel 0" val lemma_mask_cast: mask:uint16{v mask = 0 \/ v mask = v (ones U16 SEC)} -> Lemma ((v mask = 0 ==> v (to_u8 mask) = 0) /\ (v mask = v (ones U16 SEC) ==> v (to_u8 mask) = v (ones U8 SEC))) let lemma_mask_cast mask = () // To avoid integral promotion, a cast to uint_16 is needed // https://en.cppreference.com/w/cpp/language/operator_arithmetic val lemma_frodo_sample: a:uint16{v a < pow2 15} -> b:uint16{v b < pow2 15} -> Lemma (let c0 = if v a > v b then 1 else 0 in let c1 = to_u16 (to_u32 (b -. a)) >>. 15ul in v c1 == c0) let lemma_frodo_sample a b = let c = to_u16 (to_u32 (b -. a)) in assert (v c < modulus U16); Math.Lemmas.lemma_div_lt (uint_v c) 16 15; let c1 = c >>. 15ul in assert (v c1 = v c / pow2 15); Math.Lemmas.pow2_minus 16 15; assert (v c1 = 0 \/ v c1 = 1) val modulo_pow2_u16: a:uint16 -> b:size_nat{b < 16} -> Lemma (v a % pow2 b == v (a &. ((u16 1 <<. size b) -. u16 1))) let modulo_pow2_u16 a b = Math.Lemmas.pow2_lt_compat 16 b; mod_mask_lemma #U16 a (size b); assert (v (mod_mask #U16 #SEC (size b)) == v ((u16 1 <<. size b) -. u16 1)) val modulo_pow2_u64: a:uint64 -> b:size_nat{b < 64} -> Lemma (v a % pow2 b == v (a &. ((u64 1 <<. size b) -. u64 1))) let modulo_pow2_u64 a b = Math.Lemmas.pow2_lt_compat 64 b; mod_mask_lemma #U64 a (size b); assert (v (mod_mask #U64 #SEC (size b)) == v ((u64 1 <<. size b) -. u64 1)) val lognot_plus_one: e:uint16 -> Lemma (v (lognot e) == modulus U16 - v e - 1) let lognot_plus_one e = lognot_spec e; assert (v (lognot e) == UInt.lognot #16 (v e)); UInt.lemma_lognot_value_mod #16 (v e); assert (v (lognot e) == pow2 16 - v e - 1) val lemma_frodo_sample2: sign:uint16{v sign <= 1} -> e:uint16 -> Lemma (((lognot sign +. u16 1) ^. e) +. sign == u16 ((Math.Lib.powx (-1) (v sign) * v e) % modulus U16))
false
false
Spec.Frodo.Lemmas.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 0, "initial_ifuel": 0, "max_fuel": 0, "max_ifuel": 0, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": false, "z3cliopt": [], "z3refresh": false, "z3rlimit": 50, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val lemma_frodo_sample2: sign:uint16{v sign <= 1} -> e:uint16 -> Lemma (((lognot sign +. u16 1) ^. e) +. sign == u16 ((Math.Lib.powx (-1) (v sign) * v e) % modulus U16))
[]
Spec.Frodo.Lemmas.lemma_frodo_sample2
{ "file_name": "specs/frodo/Spec.Frodo.Lemmas.fst", "git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e", "git_url": "https://github.com/hacl-star/hacl-star.git", "project_name": "hacl-star" }
sign: Lib.IntTypes.uint16{Lib.IntTypes.v sign <= 1} -> e: Lib.IntTypes.uint16 -> FStar.Pervasives.Lemma (ensures (Lib.IntTypes.lognot sign +. Lib.IntTypes.u16 1 ^. e) +. sign == Lib.IntTypes.u16 (FStar.Math.Lib.powx (- 1) (Lib.IntTypes.v sign) * Lib.IntTypes.v e % Lib.IntTypes.modulus Lib.IntTypes.U16))
{ "end_col": 47, "end_line": 100, "start_col": 2, "start_line": 66 }
Prims.Tot
val aloc (r: HS.rid) (n: nat) : Tot (Type u#1)
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } )
val aloc (r: HS.rid) (n: nat) : Tot (Type u#1) let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) =
false
null
false
(l: loc_aux{loc_aux_in_addr l r n})
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "total" ]
[ "FStar.Monotonic.HyperHeap.rid", "Prims.nat", "FStar.Modifies.loc_aux", "FStar.Modifies.loc_aux_in_addr" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n
false
true
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val aloc (r: HS.rid) (n: nat) : Tot (Type u#1)
[]
FStar.Modifies.aloc
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
r: FStar.Monotonic.HyperHeap.rid -> n: Prims.nat -> Type
{ "end_col": 41, "end_line": 41, "start_col": 2, "start_line": 41 }
Prims.GTot
val loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b
val loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 =
false
null
false
match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial" ]
[ "FStar.Modifies.loc_aux", "FStar.Buffer.buffer", "Prims.l_and", "Prims.eq2", "FStar.Buffer.includes" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0
[]
FStar.Modifies.loc_aux_includes_buffer
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s: FStar.Modifies.loc_aux -> b: FStar.Buffer.buffer a -> Prims.GTot Type0
{ "end_col": 52, "end_line": 49, "start_col": 2, "start_line": 48 }
Prims.Tot
val loc_none: loc
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_none = MG.loc_none
val loc_none: loc let loc_none =
false
null
false
MG.loc_none
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "total" ]
[ "FStar.ModifiesGen.loc_none", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls
false
true
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_none: loc
[]
FStar.Modifies.loc_none
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
FStar.Modifies.loc
{ "end_col": 26, "end_line": 185, "start_col": 15, "start_line": 185 }
FStar.Pervasives.Lemma
val loc_aux_includes_trans' (s1 s2 s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3)
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3
val loc_aux_includes_trans' (s1 s2 s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) let loc_aux_includes_trans' (s1 s2 s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) =
false
null
true
Classical.move_requires (loc_aux_includes_trans s1 s2) s3
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Modifies.loc_aux", "FStar.Classical.move_requires", "Prims.l_and", "FStar.Modifies.loc_aux_includes", "FStar.Modifies.loc_aux_includes_trans", "Prims.unit", "Prims.l_True", "Prims.squash", "Prims.l_imp", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_aux_includes_trans' (s1 s2 s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3)
[]
FStar.Modifies.loc_aux_includes_trans'
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s1: FStar.Modifies.loc_aux -> s2: FStar.Modifies.loc_aux -> s3: FStar.Modifies.loc_aux -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_aux_includes s1 s2 /\ FStar.Modifies.loc_aux_includes s2 s3 ==> FStar.Modifies.loc_aux_includes s1 s3)
{ "end_col": 59, "end_line": 98, "start_col": 2, "start_line": 98 }
Prims.GTot
val loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p
val loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 =
false
null
false
match l with | LocBuffer b -> B.disjoint b p
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial" ]
[ "FStar.Modifies.loc_aux", "FStar.Buffer.buffer", "FStar.Buffer.disjoint" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0
[]
FStar.Modifies.loc_aux_disjoint_buffer
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l: FStar.Modifies.loc_aux -> p: FStar.Buffer.buffer t -> Prims.GTot Type0
{ "end_col": 33, "end_line": 106, "start_col": 2, "start_line": 105 }
Prims.GTot
val loc_includes (s1 s2: loc) : GTot Type0
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes = MG.loc_includes
val loc_includes (s1 s2: loc) : GTot Type0 let loc_includes =
false
null
false
MG.loc_includes
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial" ]
[ "FStar.ModifiesGen.loc_includes", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes (s1 s2: loc) : GTot Type0
[]
FStar.Modifies.loc_includes
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s1: FStar.Modifies.loc -> s2: FStar.Modifies.loc -> Prims.GTot Type0
{ "end_col": 34, "end_line": 206, "start_col": 19, "start_line": 206 }
Prims.GTot
val loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2)
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b
val loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) =
false
null
false
match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial", "" ]
[ "FStar.Modifies.loc_aux", "FStar.Buffer.buffer", "FStar.Modifies.loc_aux_includes_buffer" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2)
[]
FStar.Modifies.loc_aux_includes
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s1: FStar.Modifies.loc_aux -> s2: FStar.Modifies.loc_aux -> Prims.GTot Type0
{ "end_col": 47, "end_line": 56, "start_col": 2, "start_line": 55 }
Prims.Tot
val region_liveness_insensitive_locs: loc
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _
val region_liveness_insensitive_locs: loc let region_liveness_insensitive_locs =
false
null
false
MG.region_liveness_insensitive_locs _
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "total" ]
[ "FStar.ModifiesGen.region_liveness_insensitive_locs", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _
false
true
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val region_liveness_insensitive_locs: loc
[]
FStar.Modifies.region_liveness_insensitive_locs
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
FStar.Modifies.loc
{ "end_col": 76, "end_line": 275, "start_col": 39, "start_line": 275 }
Prims.Tot
val cloc_of_loc (l: loc) : Tot (MG.loc cloc_cls)
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let cloc_of_loc l = l
val cloc_of_loc (l: loc) : Tot (MG.loc cloc_cls) let cloc_of_loc l =
false
null
false
l
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "total" ]
[ "FStar.Modifies.loc", "FStar.ModifiesGen.loc", "FStar.Modifies.cloc_aloc", "FStar.Modifies.cloc_cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20" let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) ) #reset-options let modifies_buffer_rcreate_post_common #a r init len b h0 h1 = MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let mreference_live_buffer_unused_in_disjoint #t1 #pre #t2 h b1 b2 = loc_disjoint_includes (loc_freed_mreference b1) (loc_freed_mreference (B.content b2)) (loc_freed_mreference b1) (loc_buffer b2) let buffer_live_mreference_unused_in_disjoint #t1 #t2 #pre h b1 b2 = loc_disjoint_includes (loc_freed_mreference (B.content b1)) (loc_freed_mreference b2) (loc_buffer b1) (loc_freed_mreference b2) let does_not_contain_addr = MG.does_not_contain_addr let not_live_region_does_not_contain_addr = MG.not_live_region_does_not_contain_addr let unused_in_does_not_contain_addr = MG.unused_in_does_not_contain_addr let addr_unused_in_does_not_contain_addr = MG.addr_unused_in_does_not_contain_addr let free_does_not_contain_addr = MG.free_does_not_contain_addr let does_not_contain_addr_elim = MG.does_not_contain_addr_elim let modifies_only_live_addresses = MG.modifies_only_live_addresses (* Type class instance *) let cloc_aloc = aloc let cloc_cls = cls
false
true
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val cloc_of_loc (l: loc) : Tot (MG.loc cloc_cls)
[]
FStar.Modifies.cloc_of_loc
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l: FStar.Modifies.loc -> FStar.ModifiesGen.loc FStar.Modifies.cloc_cls
{ "end_col": 21, "end_line": 439, "start_col": 20, "start_line": 439 }
Prims.Tot
val cloc_cls: MG.cls cloc_aloc
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let cloc_cls = cls
val cloc_cls: MG.cls cloc_aloc let cloc_cls =
false
null
false
cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "total" ]
[ "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20" let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) ) #reset-options let modifies_buffer_rcreate_post_common #a r init len b h0 h1 = MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let mreference_live_buffer_unused_in_disjoint #t1 #pre #t2 h b1 b2 = loc_disjoint_includes (loc_freed_mreference b1) (loc_freed_mreference (B.content b2)) (loc_freed_mreference b1) (loc_buffer b2) let buffer_live_mreference_unused_in_disjoint #t1 #t2 #pre h b1 b2 = loc_disjoint_includes (loc_freed_mreference (B.content b1)) (loc_freed_mreference b2) (loc_buffer b1) (loc_freed_mreference b2) let does_not_contain_addr = MG.does_not_contain_addr let not_live_region_does_not_contain_addr = MG.not_live_region_does_not_contain_addr let unused_in_does_not_contain_addr = MG.unused_in_does_not_contain_addr let addr_unused_in_does_not_contain_addr = MG.addr_unused_in_does_not_contain_addr let free_does_not_contain_addr = MG.free_does_not_contain_addr let does_not_contain_addr_elim = MG.does_not_contain_addr_elim let modifies_only_live_addresses = MG.modifies_only_live_addresses (* Type class instance *) let cloc_aloc = aloc
false
true
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val cloc_cls: MG.cls cloc_aloc
[]
FStar.Modifies.cloc_cls
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
FStar.ModifiesGen.cls FStar.Modifies.cloc_aloc
{ "end_col": 18, "end_line": 437, "start_col": 15, "start_line": 437 }
Prims.GTot
val loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b
val loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 =
false
null
false
match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial" ]
[ "FStar.Modifies.loc_aux", "FStar.Buffer.buffer", "FStar.Modifies.loc_aux_disjoint_buffer" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0
[]
FStar.Modifies.loc_aux_disjoint
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l1: FStar.Modifies.loc_aux -> l2: FStar.Modifies.loc_aux -> Prims.GTot Type0
{ "end_col": 32, "end_line": 113, "start_col": 2, "start_line": 111 }
Prims.Tot
val loc : Type u#1
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc = MG.loc cls
val loc : Type u#1 let loc =
false
null
false
MG.loc cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "total" ]
[ "FStar.ModifiesGen.loc", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () )
false
true
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc : Type u#1
[]
FStar.Modifies.loc
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
Type
{ "end_col": 20, "end_line": 183, "start_col": 10, "start_line": 183 }
Prims.GTot
val loc_union (s1 s2: loc) : GTot loc
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_union = MG.loc_union
val loc_union (s1 s2: loc) : GTot loc let loc_union =
false
null
false
MG.loc_union
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial" ]
[ "FStar.ModifiesGen.loc_union", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_union (s1 s2: loc) : GTot loc
[]
FStar.Modifies.loc_union
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s1: FStar.Modifies.loc -> s2: FStar.Modifies.loc -> Prims.GTot FStar.Modifies.loc
{ "end_col": 28, "end_line": 187, "start_col": 16, "start_line": 187 }
Prims.GTot
val loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n
val loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 =
false
null
false
match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial" ]
[ "FStar.Modifies.loc_aux", "FStar.Monotonic.HyperHeap.rid", "Prims.nat", "FStar.Buffer.buffer", "Prims.l_and", "Prims.eq2", "FStar.Buffer.frameOf", "Prims.int", "Prims.l_or", "Prims.b2t", "Prims.op_GreaterThanOrEqual", "Prims.op_GreaterThan", "FStar.Buffer.as_addr" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0
[]
FStar.Modifies.loc_aux_in_addr
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l: FStar.Modifies.loc_aux -> r: FStar.Monotonic.HyperHeap.rid -> n: Prims.nat -> Prims.GTot Type0
{ "end_col": 20, "end_line": 38, "start_col": 2, "start_line": 35 }
FStar.Pervasives.Lemma
val loc_union_loc_none_l (s: loc) : Lemma (loc_union loc_none s == s) [SMTPat (loc_union loc_none s)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_union_loc_none_l = MG.loc_union_loc_none_l
val loc_union_loc_none_l (s: loc) : Lemma (loc_union loc_none s == s) [SMTPat (loc_union loc_none s)] let loc_union_loc_none_l =
false
null
true
MG.loc_union_loc_none_l
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_union_loc_none_l", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_union_loc_none_l (s: loc) : Lemma (loc_union loc_none s == s) [SMTPat (loc_union loc_none s)]
[]
FStar.Modifies.loc_union_loc_none_l
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s: FStar.Modifies.loc -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_union FStar.Modifies.loc_none s == s) [SMTPat (FStar.Modifies.loc_union FStar.Modifies.loc_none s)]
{ "end_col": 50, "end_line": 195, "start_col": 27, "start_line": 195 }
FStar.Pervasives.Lemma
val loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3))
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b
val loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) =
false
null
true
match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Modifies.loc_aux", "FStar.Buffer.buffer", "FStar.Modifies.loc_aux_includes_loc_aux_includes_buffer", "Prims.unit", "Prims.l_and", "FStar.Modifies.loc_aux_includes", "Prims.squash", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3))
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3))
[]
FStar.Modifies.loc_aux_includes_trans
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s1: FStar.Modifies.loc_aux -> s2: FStar.Modifies.loc_aux -> s3: FStar.Modifies.loc_aux -> FStar.Pervasives.Lemma (requires FStar.Modifies.loc_aux_includes s1 s2 /\ FStar.Modifies.loc_aux_includes s2 s3) (ensures FStar.Modifies.loc_aux_includes s1 s3)
{ "end_col": 67, "end_line": 89, "start_col": 2, "start_line": 88 }
Prims.GTot
val loc_regions (preserve_liveness: bool) (r: Set.set HS.rid) : GTot loc
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_regions = MG.loc_regions
val loc_regions (preserve_liveness: bool) (r: Set.set HS.rid) : GTot loc let loc_regions =
false
null
false
MG.loc_regions
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial" ]
[ "FStar.ModifiesGen.loc_regions", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_regions (preserve_liveness: bool) (r: Set.set HS.rid) : GTot loc
[]
FStar.Modifies.loc_regions
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
preserve_liveness: Prims.bool -> r: FStar.Set.set FStar.Monotonic.HyperHeap.rid -> Prims.GTot FStar.Modifies.loc
{ "end_col": 32, "end_line": 204, "start_col": 18, "start_line": 204 }
Prims.GTot
val loc_buffer (#t: Type) (b: B.buffer t) : GTot loc
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b)
val loc_buffer (#t: Type) (b: B.buffer t) : GTot loc let loc_buffer #t b =
false
null
false
MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b)
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial" ]
[ "FStar.Buffer.buffer", "FStar.ModifiesGen.loc_of_aloc", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Buffer.frameOf", "FStar.Buffer.as_addr", "FStar.Modifies.LocBuffer", "FStar.Modifies.loc" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_buffer (#t: Type) (b: B.buffer t) : GTot loc
[]
FStar.Modifies.loc_buffer
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
b: FStar.Buffer.buffer t -> Prims.GTot FStar.Modifies.loc
{ "end_col": 68, "end_line": 200, "start_col": 2, "start_line": 200 }
FStar.Pervasives.Lemma
val loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3))
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3
val loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) =
false
null
true
match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Modifies.loc_aux", "FStar.Buffer.buffer", "FStar.Modifies.loc_aux_disjoint_loc_aux_includes_buffer", "Prims.unit", "Prims.l_and", "FStar.Modifies.loc_aux_disjoint", "FStar.Modifies.loc_aux_includes", "Prims.squash", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3))
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3))
[]
FStar.Modifies.loc_aux_disjoint_loc_aux_includes
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l1: FStar.Modifies.loc_aux -> l2: FStar.Modifies.loc_aux -> l3: FStar.Modifies.loc_aux -> FStar.Pervasives.Lemma (requires FStar.Modifies.loc_aux_disjoint l1 l2 /\ FStar.Modifies.loc_aux_includes l2 l3) (ensures FStar.Modifies.loc_aux_disjoint l1 l3)
{ "end_col": 53, "end_line": 148, "start_col": 2, "start_line": 146 }
FStar.Pervasives.Lemma
val loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b))
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b
val loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) =
false
null
true
match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Modifies.loc_aux", "FStar.Buffer.buffer", "FStar.Modifies.loc_aux_includes_buffer_includes", "Prims.unit", "Prims.l_and", "FStar.Modifies.loc_aux_includes", "FStar.Modifies.loc_aux_includes_buffer", "Prims.squash", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b))
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b))
[]
FStar.Modifies.loc_aux_includes_loc_aux_includes_buffer
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s1: FStar.Modifies.loc_aux -> s2: FStar.Modifies.loc_aux -> b: FStar.Buffer.buffer a -> FStar.Pervasives.Lemma (requires FStar.Modifies.loc_aux_includes s1 s2 /\ FStar.Modifies.loc_aux_includes_buffer s2 b ) (ensures FStar.Modifies.loc_aux_includes_buffer s1 b)
{ "end_col": 60, "end_line": 81, "start_col": 2, "start_line": 80 }
FStar.Pervasives.Lemma
val loc_union_comm (s1 s2: loc) : Lemma (loc_union s1 s2 == loc_union s2 s1) [SMTPat (loc_union s1 s2)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_union_comm = MG.loc_union_comm
val loc_union_comm (s1 s2: loc) : Lemma (loc_union s1 s2 == loc_union s2 s1) [SMTPat (loc_union s1 s2)] let loc_union_comm =
false
null
true
MG.loc_union_comm
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_union_comm", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_union_comm (s1 s2: loc) : Lemma (loc_union s1 s2 == loc_union s2 s1) [SMTPat (loc_union s1 s2)]
[]
FStar.Modifies.loc_union_comm
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s1: FStar.Modifies.loc -> s2: FStar.Modifies.loc -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_union s1 s2 == FStar.Modifies.loc_union s2 s1) [SMTPat (FStar.Modifies.loc_union s1 s2)]
{ "end_col": 38, "end_line": 191, "start_col": 21, "start_line": 191 }
FStar.Pervasives.Lemma
val loc_disjoint_sym (s1 s2: loc) : Lemma (requires (loc_disjoint s1 s2)) (ensures (loc_disjoint s2 s1))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_disjoint_sym = MG.loc_disjoint_sym
val loc_disjoint_sym (s1 s2: loc) : Lemma (requires (loc_disjoint s1 s2)) (ensures (loc_disjoint s2 s1)) let loc_disjoint_sym =
false
null
true
MG.loc_disjoint_sym
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_disjoint_sym", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_disjoint_sym (s1 s2: loc) : Lemma (requires (loc_disjoint s1 s2)) (ensures (loc_disjoint s2 s1))
[]
FStar.Modifies.loc_disjoint_sym
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s1: FStar.Modifies.loc -> s2: FStar.Modifies.loc -> FStar.Pervasives.Lemma (requires FStar.Modifies.loc_disjoint s1 s2) (ensures FStar.Modifies.loc_disjoint s2 s1)
{ "end_col": 42, "end_line": 242, "start_col": 23, "start_line": 242 }
FStar.Pervasives.Lemma
val loc_includes_union_l (s1 s2 s: loc) : Lemma (requires (loc_includes s1 s \/ loc_includes s2 s)) (ensures (loc_includes (loc_union s1 s2) s)) [SMTPat (loc_includes (loc_union s1 s2) s)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes_union_l = MG.loc_includes_union_l
val loc_includes_union_l (s1 s2 s: loc) : Lemma (requires (loc_includes s1 s \/ loc_includes s2 s)) (ensures (loc_includes (loc_union s1 s2) s)) [SMTPat (loc_includes (loc_union s1 s2) s)] let loc_includes_union_l =
false
null
true
MG.loc_includes_union_l
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_includes_union_l", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes_union_l (s1 s2 s: loc) : Lemma (requires (loc_includes s1 s \/ loc_includes s2 s)) (ensures (loc_includes (loc_union s1 s2) s)) [SMTPat (loc_includes (loc_union s1 s2) s)]
[]
FStar.Modifies.loc_includes_union_l
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s1: FStar.Modifies.loc -> s2: FStar.Modifies.loc -> s: FStar.Modifies.loc -> FStar.Pervasives.Lemma (requires FStar.Modifies.loc_includes s1 s \/ FStar.Modifies.loc_includes s2 s) (ensures FStar.Modifies.loc_includes (FStar.Modifies.loc_union s1 s2) s) [SMTPat (FStar.Modifies.loc_includes (FStar.Modifies.loc_union s1 s2) s)]
{ "end_col": 50, "end_line": 214, "start_col": 27, "start_line": 214 }
FStar.Pervasives.Lemma
val loc_includes_region_region (preserve_liveness1: bool) (preserve_liveness2: bool) (s1 s2: Set.set HS.rid) : Lemma (requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1)) (ensures (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2))) [SMTPat (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes_region_region = MG.loc_includes_region_region #_ #cls
val loc_includes_region_region (preserve_liveness1: bool) (preserve_liveness2: bool) (s1 s2: Set.set HS.rid) : Lemma (requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1)) (ensures (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2))) [SMTPat (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2))] let loc_includes_region_region =
false
null
true
MG.loc_includes_region_region #_ #cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_includes_region_region", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes_region_region (preserve_liveness1: bool) (preserve_liveness2: bool) (s1 s2: Set.set HS.rid) : Lemma (requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1)) (ensures (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2))) [SMTPat (loc_includes (loc_regions preserve_liveness1 s1) (loc_regions preserve_liveness2 s2))]
[]
FStar.Modifies.loc_includes_region_region
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
preserve_liveness1: Prims.bool -> preserve_liveness2: Prims.bool -> s1: FStar.Set.set FStar.Monotonic.HyperHeap.rid -> s2: FStar.Set.set FStar.Monotonic.HyperHeap.rid -> FStar.Pervasives.Lemma (requires (preserve_liveness1 ==> preserve_liveness2) /\ FStar.Set.subset s2 s1) (ensures FStar.Modifies.loc_includes (FStar.Modifies.loc_regions preserve_liveness1 s1) (FStar.Modifies.loc_regions preserve_liveness2 s2)) [ SMTPat (FStar.Modifies.loc_includes (FStar.Modifies.loc_regions preserve_liveness1 s1) (FStar.Modifies.loc_regions preserve_liveness2 s2)) ]
{ "end_col": 70, "end_line": 234, "start_col": 33, "start_line": 234 }
FStar.Pervasives.Lemma
val loc_disjoint_none_r (s: loc) : Lemma (ensures (loc_disjoint s loc_none)) [SMTPat (loc_disjoint s loc_none)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_disjoint_none_r = MG.loc_disjoint_none_r
val loc_disjoint_none_r (s: loc) : Lemma (ensures (loc_disjoint s loc_none)) [SMTPat (loc_disjoint s loc_none)] let loc_disjoint_none_r =
false
null
true
MG.loc_disjoint_none_r
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_disjoint_none_r", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_disjoint_none_r (s: loc) : Lemma (ensures (loc_disjoint s loc_none)) [SMTPat (loc_disjoint s loc_none)]
[]
FStar.Modifies.loc_disjoint_none_r
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s: FStar.Modifies.loc -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_disjoint s FStar.Modifies.loc_none) [SMTPat (FStar.Modifies.loc_disjoint s FStar.Modifies.loc_none)]
{ "end_col": 48, "end_line": 244, "start_col": 26, "start_line": 244 }
FStar.Pervasives.Lemma
val loc_union_idem (s: loc) : Lemma (loc_union s s == s) [SMTPat (loc_union s s)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_union_idem = MG.loc_union_idem
val loc_union_idem (s: loc) : Lemma (loc_union s s == s) [SMTPat (loc_union s s)] let loc_union_idem =
false
null
true
MG.loc_union_idem
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_union_idem", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_union_idem (s: loc) : Lemma (loc_union s s == s) [SMTPat (loc_union s s)]
[]
FStar.Modifies.loc_union_idem
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s: FStar.Modifies.loc -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_union s s == s) [SMTPat (FStar.Modifies.loc_union s s)]
{ "end_col": 38, "end_line": 189, "start_col": 21, "start_line": 189 }
FStar.Pervasives.Lemma
val modifies_fresh_frame_popped (h0 h1: HS.mem) (s: loc) (h2 h3: HS.mem) : Lemma (requires ( HS.fresh_frame h0 h1 /\ modifies (loc_union (loc_all_regions_from false (HS.get_tip h1)) s) h1 h2 /\ (HS.get_tip h2) == (HS.get_tip h1) /\ HS.popped h2 h3 )) (ensures ( modifies s h0 h3 /\ (HS.get_tip h3) == HS.get_tip h0 )) [SMTPat (HS.fresh_frame h0 h1); SMTPat (HS.popped h2 h3); SMTPat (modifies s h0 h3)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped
val modifies_fresh_frame_popped (h0 h1: HS.mem) (s: loc) (h2 h3: HS.mem) : Lemma (requires ( HS.fresh_frame h0 h1 /\ modifies (loc_union (loc_all_regions_from false (HS.get_tip h1)) s) h1 h2 /\ (HS.get_tip h2) == (HS.get_tip h1) /\ HS.popped h2 h3 )) (ensures ( modifies s h0 h3 /\ (HS.get_tip h3) == HS.get_tip h0 )) [SMTPat (HS.fresh_frame h0 h1); SMTPat (HS.popped h2 h3); SMTPat (modifies s h0 h3)] let modifies_fresh_frame_popped =
false
null
true
MG.modifies_fresh_frame_popped
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_fresh_frame_popped", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_fresh_frame_popped (h0 h1: HS.mem) (s: loc) (h2 h3: HS.mem) : Lemma (requires ( HS.fresh_frame h0 h1 /\ modifies (loc_union (loc_all_regions_from false (HS.get_tip h1)) s) h1 h2 /\ (HS.get_tip h2) == (HS.get_tip h1) /\ HS.popped h2 h3 )) (ensures ( modifies s h0 h3 /\ (HS.get_tip h3) == HS.get_tip h0 )) [SMTPat (HS.fresh_frame h0 h1); SMTPat (HS.popped h2 h3); SMTPat (modifies s h0 h3)]
[]
FStar.Modifies.modifies_fresh_frame_popped
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
h0: FStar.Monotonic.HyperStack.mem -> h1: FStar.Monotonic.HyperStack.mem -> s: FStar.Modifies.loc -> h2: FStar.Monotonic.HyperStack.mem -> h3: FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Monotonic.HyperStack.fresh_frame h0 h1 /\ FStar.Modifies.modifies (FStar.Modifies.loc_union (FStar.Modifies.loc_all_regions_from false (FStar.Monotonic.HyperStack.get_tip h1)) s) h1 h2 /\ FStar.Monotonic.HyperStack.get_tip h2 == FStar.Monotonic.HyperStack.get_tip h1 /\ FStar.Monotonic.HyperStack.popped h2 h3) (ensures FStar.Modifies.modifies s h0 h3 /\ FStar.Monotonic.HyperStack.get_tip h3 == FStar.Monotonic.HyperStack.get_tip h0) [ SMTPat (FStar.Monotonic.HyperStack.fresh_frame h0 h1); SMTPat (FStar.Monotonic.HyperStack.popped h2 h3); SMTPat (FStar.Modifies.modifies s h0 h3) ]
{ "end_col": 64, "end_line": 314, "start_col": 34, "start_line": 314 }
FStar.Pervasives.Lemma
val modifies_liveness_insensitive_mreference (l1 l2 : loc) (h h' : HS.mem) (#t: Type) (#pre: Preorder.preorder t) (x: HS.mreference t pre) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ h `HS.contains` x)) (ensures (h' `HS.contains` x))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness
val modifies_liveness_insensitive_mreference (l1 l2 : loc) (h h' : HS.mem) (#t: Type) (#pre: Preorder.preorder t) (x: HS.mreference t pre) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ h `HS.contains` x)) (ensures (h' `HS.contains` x)) let modifies_liveness_insensitive_mreference =
false
null
true
MG.modifies_preserves_liveness
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_preserves_liveness", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_liveness_insensitive_mreference (l1 l2 : loc) (h h' : HS.mem) (#t: Type) (#pre: Preorder.preorder t) (x: HS.mreference t pre) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ h `HS.contains` x)) (ensures (h' `HS.contains` x))
[]
FStar.Modifies.modifies_liveness_insensitive_mreference
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l1: FStar.Modifies.loc -> l2: FStar.Modifies.loc -> h: FStar.Monotonic.HyperStack.mem -> h': FStar.Monotonic.HyperStack.mem -> x: FStar.Monotonic.HyperStack.mreference t pre -> FStar.Pervasives.Lemma (requires FStar.Modifies.modifies (FStar.Modifies.loc_union l1 l2) h h' /\ FStar.Modifies.loc_disjoint l1 (FStar.Modifies.loc_mreference x) /\ FStar.Modifies.loc_includes FStar.Modifies.address_liveness_insensitive_locs l2 /\ FStar.Monotonic.HyperStack.contains h x) (ensures FStar.Monotonic.HyperStack.contains h' x)
{ "end_col": 77, "end_line": 295, "start_col": 47, "start_line": 295 }
FStar.Pervasives.Lemma
val modifies_liveness_insensitive_buffer (l1 l2 : loc) (h h' : HS.mem) (#t: Type) (x: B.buffer t) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ B.live h x)) (ensures (B.live h' x))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x)
val modifies_liveness_insensitive_buffer (l1 l2 : loc) (h h' : HS.mem) (#t: Type) (x: B.buffer t) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ B.live h x)) (ensures (B.live h' x)) let modifies_liveness_insensitive_buffer l1 l2 h h' #t x =
false
null
true
MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x)
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Modifies.loc", "FStar.Monotonic.HyperStack.mem", "FStar.Buffer.buffer", "FStar.ModifiesGen.modifies_preserves_liveness_strong", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Buffer.lseq", "FStar.Buffer.max_length", "FStar.Heap.trivial_preorder", "FStar.Buffer.content", "FStar.Modifies.LocBuffer", "Prims.unit" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_liveness_insensitive_buffer (l1 l2 : loc) (h h' : HS.mem) (#t: Type) (x: B.buffer t) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ address_liveness_insensitive_locs `loc_includes` l2 /\ B.live h x)) (ensures (B.live h' x))
[]
FStar.Modifies.modifies_liveness_insensitive_buffer
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l1: FStar.Modifies.loc -> l2: FStar.Modifies.loc -> h: FStar.Monotonic.HyperStack.mem -> h': FStar.Monotonic.HyperStack.mem -> x: FStar.Buffer.buffer t -> FStar.Pervasives.Lemma (requires FStar.Modifies.modifies (FStar.Modifies.loc_union l1 l2) h h' /\ FStar.Modifies.loc_disjoint l1 (FStar.Modifies.loc_buffer x) /\ FStar.Modifies.loc_includes FStar.Modifies.address_liveness_insensitive_locs l2 /\ FStar.Buffer.live h x) (ensures FStar.Buffer.live h' x)
{ "end_col": 78, "end_line": 298, "start_col": 2, "start_line": 298 }
FStar.Pervasives.Lemma
val mreference_live_buffer_unused_in_disjoint (#t1: Type) (#pre: Preorder.preorder t1) (#t2: Type) (h: HS.mem) (b1: HS.mreference t1 pre) (b2: B.buffer t2) : Lemma (requires (HS.contains h b1 /\ B.unused_in b2 h)) (ensures (loc_disjoint (loc_freed_mreference b1) (loc_buffer b2))) [SMTPat (HS.contains h b1); SMTPat (B.unused_in b2 h)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let mreference_live_buffer_unused_in_disjoint #t1 #pre #t2 h b1 b2 = loc_disjoint_includes (loc_freed_mreference b1) (loc_freed_mreference (B.content b2)) (loc_freed_mreference b1) (loc_buffer b2)
val mreference_live_buffer_unused_in_disjoint (#t1: Type) (#pre: Preorder.preorder t1) (#t2: Type) (h: HS.mem) (b1: HS.mreference t1 pre) (b2: B.buffer t2) : Lemma (requires (HS.contains h b1 /\ B.unused_in b2 h)) (ensures (loc_disjoint (loc_freed_mreference b1) (loc_buffer b2))) [SMTPat (HS.contains h b1); SMTPat (B.unused_in b2 h)] let mreference_live_buffer_unused_in_disjoint #t1 #pre #t2 h b1 b2 =
false
null
true
loc_disjoint_includes (loc_freed_mreference b1) (loc_freed_mreference (B.content b2)) (loc_freed_mreference b1) (loc_buffer b2)
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Preorder.preorder", "FStar.Monotonic.HyperStack.mem", "FStar.Monotonic.HyperStack.mreference", "FStar.Buffer.buffer", "FStar.Modifies.loc_disjoint_includes", "FStar.Modifies.loc_freed_mreference", "FStar.Buffer.lseq", "FStar.Buffer.max_length", "FStar.Heap.trivial_preorder", "FStar.Buffer.content", "FStar.Modifies.loc_buffer", "Prims.unit" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20" let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) ) #reset-options let modifies_buffer_rcreate_post_common #a r init len b h0 h1 = MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ())
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val mreference_live_buffer_unused_in_disjoint (#t1: Type) (#pre: Preorder.preorder t1) (#t2: Type) (h: HS.mem) (b1: HS.mreference t1 pre) (b2: B.buffer t2) : Lemma (requires (HS.contains h b1 /\ B.unused_in b2 h)) (ensures (loc_disjoint (loc_freed_mreference b1) (loc_buffer b2))) [SMTPat (HS.contains h b1); SMTPat (B.unused_in b2 h)]
[]
FStar.Modifies.mreference_live_buffer_unused_in_disjoint
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
h: FStar.Monotonic.HyperStack.mem -> b1: FStar.Monotonic.HyperStack.mreference t1 pre -> b2: FStar.Buffer.buffer t2 -> FStar.Pervasives.Lemma (requires FStar.Monotonic.HyperStack.contains h b1 /\ FStar.Buffer.unused_in b2 h) (ensures FStar.Modifies.loc_disjoint (FStar.Modifies.loc_freed_mreference b1) (FStar.Modifies.loc_buffer b2)) [SMTPat (FStar.Monotonic.HyperStack.contains h b1); SMTPat (FStar.Buffer.unused_in b2 h)]
{ "end_col": 129, "end_line": 413, "start_col": 2, "start_line": 413 }
FStar.Pervasives.Lemma
val modifies_0_modifies (h1 h2: HS.mem) : Lemma (requires (B.modifies_0 h1 h2)) (ensures (modifies loc_none h1 h2)) [SMTPat (B.modifies_0 h1 h2)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ())
val modifies_0_modifies (h1 h2: HS.mem) : Lemma (requires (B.modifies_0 h1 h2)) (ensures (modifies loc_none h1 h2)) [SMTPat (B.modifies_0 h1 h2)] let modifies_0_modifies h1 h2 =
false
null
true
B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ())
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Monotonic.HyperStack.mem", "FStar.ModifiesGen.modifies_none_intro", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Monotonic.HyperHeap.rid", "Prims.unit", "FStar.Preorder.preorder", "FStar.Monotonic.HyperStack.mreference", "Prims.nat", "FStar.Buffer.lemma_reveal_modifies_0" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ())
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_0_modifies (h1 h2: HS.mem) : Lemma (requires (B.modifies_0 h1 h2)) (ensures (modifies loc_none h1 h2)) [SMTPat (B.modifies_0 h1 h2)]
[]
FStar.Modifies.modifies_0_modifies
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
h1: FStar.Monotonic.HyperStack.mem -> h2: FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Buffer.modifies_0 h1 h2) (ensures FStar.Modifies.modifies FStar.Modifies.loc_none h1 h2) [SMTPat (FStar.Buffer.modifies_0 h1 h2)]
{ "end_col": 19, "end_line": 339, "start_col": 2, "start_line": 335 }
FStar.Pervasives.Lemma
val modifies_loc_regions_intro (rs: Set.set HS.rid) (h1 h2: HS.mem) : Lemma (requires (HS.modifies rs h1 h2)) (ensures (modifies (loc_regions true rs) h1 h2))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls
val modifies_loc_regions_intro (rs: Set.set HS.rid) (h1 h2: HS.mem) : Lemma (requires (HS.modifies rs h1 h2)) (ensures (modifies (loc_regions true rs) h1 h2)) let modifies_loc_regions_intro =
false
null
true
MG.modifies_loc_regions_intro #_ #cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_loc_regions_intro", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_loc_regions_intro (rs: Set.set HS.rid) (h1 h2: HS.mem) : Lemma (requires (HS.modifies rs h1 h2)) (ensures (modifies (loc_regions true rs) h1 h2))
[]
FStar.Modifies.modifies_loc_regions_intro
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
rs: FStar.Set.set FStar.Monotonic.HyperHeap.rid -> h1: FStar.Monotonic.HyperStack.mem -> h2: FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Monotonic.HyperStack.modifies rs h1 h2) (ensures FStar.Modifies.modifies (FStar.Modifies.loc_regions true rs) h1 h2)
{ "end_col": 70, "end_line": 316, "start_col": 33, "start_line": 316 }
FStar.Pervasives.Lemma
val modifies_loc_includes (s1: loc) (h h': HS.mem) (s2: loc) : Lemma (requires (modifies s2 h h' /\ loc_includes s1 s2)) (ensures (modifies s1 h h')) [SMTPatOr [ [SMTPat (modifies s1 h h'); SMTPat (modifies s2 h h')]; [SMTPat (modifies s1 h h'); SMTPat (loc_includes s1 s2)]; [SMTPat (modifies s2 h h'); SMTPat (loc_includes s1 s2)]; ]]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_loc_includes = MG.modifies_loc_includes
val modifies_loc_includes (s1: loc) (h h': HS.mem) (s2: loc) : Lemma (requires (modifies s2 h h' /\ loc_includes s1 s2)) (ensures (modifies s1 h h')) [SMTPatOr [ [SMTPat (modifies s1 h h'); SMTPat (modifies s2 h h')]; [SMTPat (modifies s1 h h'); SMTPat (loc_includes s1 s2)]; [SMTPat (modifies s2 h h'); SMTPat (loc_includes s1 s2)]; ]] let modifies_loc_includes =
false
null
true
MG.modifies_loc_includes
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_loc_includes", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_loc_includes (s1: loc) (h h': HS.mem) (s2: loc) : Lemma (requires (modifies s2 h h' /\ loc_includes s1 s2)) (ensures (modifies s1 h h')) [SMTPatOr [ [SMTPat (modifies s1 h h'); SMTPat (modifies s2 h h')]; [SMTPat (modifies s1 h h'); SMTPat (loc_includes s1 s2)]; [SMTPat (modifies s2 h h'); SMTPat (loc_includes s1 s2)]; ]]
[]
FStar.Modifies.modifies_loc_includes
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s1: FStar.Modifies.loc -> h: FStar.Monotonic.HyperStack.mem -> h': FStar.Monotonic.HyperStack.mem -> s2: FStar.Modifies.loc -> FStar.Pervasives.Lemma (requires FStar.Modifies.modifies s2 h h' /\ FStar.Modifies.loc_includes s1 s2) (ensures FStar.Modifies.modifies s1 h h') [ SMTPatOr [ [SMTPat (FStar.Modifies.modifies s1 h h'); SMTPat (FStar.Modifies.modifies s2 h h')]; [SMTPat (FStar.Modifies.modifies s1 h h'); SMTPat (FStar.Modifies.loc_includes s1 s2)]; [SMTPat (FStar.Modifies.modifies s2 h h'); SMTPat (FStar.Modifies.loc_includes s1 s2)] ] ]
{ "end_col": 52, "end_line": 271, "start_col": 28, "start_line": 271 }
FStar.Pervasives.Lemma
val modifies_liveness_insensitive_region (l1 l2 : loc) (h h' : HS.mem) (x: HS.rid) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_region_only false x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h x)) (ensures (HS.live_region h' x))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness
val modifies_liveness_insensitive_region (l1 l2 : loc) (h h' : HS.mem) (x: HS.rid) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_region_only false x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h x)) (ensures (HS.live_region h' x)) let modifies_liveness_insensitive_region =
false
null
true
MG.modifies_preserves_region_liveness
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_preserves_region_liveness", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_liveness_insensitive_region (l1 l2 : loc) (h h' : HS.mem) (x: HS.rid) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_region_only false x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h x)) (ensures (HS.live_region h' x))
[]
FStar.Modifies.modifies_liveness_insensitive_region
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l1: FStar.Modifies.loc -> l2: FStar.Modifies.loc -> h: FStar.Monotonic.HyperStack.mem -> h': FStar.Monotonic.HyperStack.mem -> x: FStar.Monotonic.HyperHeap.rid -> FStar.Pervasives.Lemma (requires FStar.Modifies.modifies (FStar.Modifies.loc_union l1 l2) h h' /\ FStar.Modifies.loc_disjoint l1 (FStar.Modifies.loc_region_only false x) /\ FStar.Modifies.loc_includes FStar.Modifies.region_liveness_insensitive_locs l2 /\ FStar.Monotonic.HyperStack.live_region h x) (ensures FStar.Monotonic.HyperStack.live_region h' x)
{ "end_col": 80, "end_line": 300, "start_col": 43, "start_line": 300 }
Prims.Tot
val cls:MG.cls aloc
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () )
val cls:MG.cls aloc let cls:MG.cls aloc =
false
null
false
MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g ())
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "total" ]
[ "FStar.ModifiesGen.Cls", "FStar.Modifies.aloc", "FStar.Monotonic.HyperHeap.rid", "Prims.nat", "FStar.Modifies.loc_aux_includes", "Prims.unit", "FStar.Modifies.loc_aux_disjoint", "FStar.Modifies.loc_aux_preserved", "FStar.Monotonic.HyperStack.mem", "FStar.Preorder.preorder", "FStar.Monotonic.HyperStack.mreference", "Prims.l_and", "FStar.Monotonic.HyperStack.contains", "Prims.eq2", "FStar.Monotonic.HyperStack.frameOf", "Prims.int", "Prims.l_or", "Prims.b2t", "Prims.op_GreaterThan", "Prims.op_GreaterThanOrEqual", "FStar.Monotonic.HyperStack.as_addr", "Prims.squash", "FStar.Monotonic.HyperStack.sel", "Prims.Nil", "FStar.Pervasives.pattern", "FStar.Buffer.buffer", "FStar.Classical.move_requires", "FStar.Buffer.live", "FStar.Buffer.lseq", "FStar.Buffer.max_length", "FStar.Heap.trivial_preorder", "FStar.Buffer.content" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen
false
true
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val cls:MG.cls aloc
[]
FStar.Modifies.cls
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
FStar.ModifiesGen.cls FStar.Modifies.aloc
{ "end_col": 3, "end_line": 181, "start_col": 24, "start_line": 162 }
FStar.Pervasives.Lemma
val modifies_buffer_elim (#t1: Type) (b: B.buffer t1) (p: loc) (h h': HS.mem) : Lemma (requires ( loc_disjoint (loc_buffer b) p /\ B.live h b /\ modifies p h h' )) (ensures ( B.live h' b /\ ( B.as_seq h b == B.as_seq h' b ))) [SMTPatOr [ [ SMTPat (modifies p h h'); SMTPat (B.as_seq h b) ] ; [ SMTPat (modifies p h h'); SMTPat (B.live h b) ]; [ SMTPat (modifies p h h'); SMTPat (B.as_seq h' b) ] ; [ SMTPat (modifies p h h'); SMTPat (B.live h' b) ] ] ]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h'
val modifies_buffer_elim (#t1: Type) (b: B.buffer t1) (p: loc) (h h': HS.mem) : Lemma (requires ( loc_disjoint (loc_buffer b) p /\ B.live h b /\ modifies p h h' )) (ensures ( B.live h' b /\ ( B.as_seq h b == B.as_seq h' b ))) [SMTPatOr [ [ SMTPat (modifies p h h'); SMTPat (B.as_seq h b) ] ; [ SMTPat (modifies p h h'); SMTPat (B.live h b) ]; [ SMTPat (modifies p h h'); SMTPat (B.as_seq h' b) ] ; [ SMTPat (modifies p h h'); SMTPat (B.live h' b) ] ] ] let modifies_buffer_elim #t1 b p h h' =
false
null
true
MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h'
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Buffer.buffer", "FStar.Modifies.loc", "FStar.Monotonic.HyperStack.mem", "FStar.ModifiesGen.modifies_aloc_elim", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Buffer.frameOf", "FStar.Buffer.as_addr", "FStar.Modifies.LocBuffer", "Prims.unit" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_buffer_elim (#t1: Type) (b: B.buffer t1) (p: loc) (h h': HS.mem) : Lemma (requires ( loc_disjoint (loc_buffer b) p /\ B.live h b /\ modifies p h h' )) (ensures ( B.live h' b /\ ( B.as_seq h b == B.as_seq h' b ))) [SMTPatOr [ [ SMTPat (modifies p h h'); SMTPat (B.as_seq h b) ] ; [ SMTPat (modifies p h h'); SMTPat (B.live h b) ]; [ SMTPat (modifies p h h'); SMTPat (B.as_seq h' b) ] ; [ SMTPat (modifies p h h'); SMTPat (B.live h' b) ] ] ]
[]
FStar.Modifies.modifies_buffer_elim
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
b: FStar.Buffer.buffer t1 -> p: FStar.Modifies.loc -> h: FStar.Monotonic.HyperStack.mem -> h': FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Modifies.loc_disjoint (FStar.Modifies.loc_buffer b) p /\ FStar.Buffer.live h b /\ FStar.Modifies.modifies p h h') (ensures FStar.Buffer.live h' b /\ FStar.Buffer.as_seq h b == FStar.Buffer.as_seq h' b) [ SMTPatOr [ [SMTPat (FStar.Modifies.modifies p h h'); SMTPat (FStar.Buffer.as_seq h b)]; [SMTPat (FStar.Modifies.modifies p h h'); SMTPat (FStar.Buffer.live h b)]; [SMTPat (FStar.Modifies.modifies p h h'); SMTPat (FStar.Buffer.as_seq h' b)]; [SMTPat (FStar.Modifies.modifies p h h'); SMTPat (FStar.Buffer.live h' b)] ] ]
{ "end_col": 82, "end_line": 267, "start_col": 2, "start_line": 267 }
FStar.Pervasives.Lemma
val unused_in_does_not_contain_addr (h: HS.mem) (#a: Type) (#rel: Preorder.preorder a) (r: HS.mreference a rel) : Lemma (requires (r `HS.unused_in` h)) (ensures (h `does_not_contain_addr` (HS.frameOf r, HS.as_addr r)))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let unused_in_does_not_contain_addr = MG.unused_in_does_not_contain_addr
val unused_in_does_not_contain_addr (h: HS.mem) (#a: Type) (#rel: Preorder.preorder a) (r: HS.mreference a rel) : Lemma (requires (r `HS.unused_in` h)) (ensures (h `does_not_contain_addr` (HS.frameOf r, HS.as_addr r))) let unused_in_does_not_contain_addr =
false
null
true
MG.unused_in_does_not_contain_addr
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.unused_in_does_not_contain_addr" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20" let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) ) #reset-options let modifies_buffer_rcreate_post_common #a r init len b h0 h1 = MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let mreference_live_buffer_unused_in_disjoint #t1 #pre #t2 h b1 b2 = loc_disjoint_includes (loc_freed_mreference b1) (loc_freed_mreference (B.content b2)) (loc_freed_mreference b1) (loc_buffer b2) let buffer_live_mreference_unused_in_disjoint #t1 #t2 #pre h b1 b2 = loc_disjoint_includes (loc_freed_mreference (B.content b1)) (loc_freed_mreference b2) (loc_buffer b1) (loc_freed_mreference b2) let does_not_contain_addr = MG.does_not_contain_addr let not_live_region_does_not_contain_addr = MG.not_live_region_does_not_contain_addr
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val unused_in_does_not_contain_addr (h: HS.mem) (#a: Type) (#rel: Preorder.preorder a) (r: HS.mreference a rel) : Lemma (requires (r `HS.unused_in` h)) (ensures (h `does_not_contain_addr` (HS.frameOf r, HS.as_addr r)))
[]
FStar.Modifies.unused_in_does_not_contain_addr
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
h: FStar.Monotonic.HyperStack.mem -> r: FStar.Monotonic.HyperStack.mreference a rel -> FStar.Pervasives.Lemma (requires FStar.Monotonic.HyperStack.unused_in r h) (ensures FStar.Modifies.does_not_contain_addr h (FStar.Monotonic.HyperStack.frameOf r, FStar.Monotonic.HyperStack.as_addr r))
{ "end_col": 72, "end_line": 422, "start_col": 38, "start_line": 422 }
FStar.Pervasives.Lemma
val modifies_only_live_regions (rs: Set.set HS.rid) (l: loc) (h h' : HS.mem) : Lemma (requires ( modifies (loc_union (loc_regions false rs) l) h h' /\ (forall r . Set.mem r rs ==> (~ (HS.live_region h r))) )) (ensures (modifies l h h'))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_only_live_regions = MG.modifies_only_live_regions
val modifies_only_live_regions (rs: Set.set HS.rid) (l: loc) (h h' : HS.mem) : Lemma (requires ( modifies (loc_union (loc_regions false rs) l) h h' /\ (forall r . Set.mem r rs ==> (~ (HS.live_region h r))) )) (ensures (modifies l h h')) let modifies_only_live_regions =
false
null
true
MG.modifies_only_live_regions
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_only_live_regions", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_only_live_regions (rs: Set.set HS.rid) (l: loc) (h h' : HS.mem) : Lemma (requires ( modifies (loc_union (loc_regions false rs) l) h h' /\ (forall r . Set.mem r rs ==> (~ (HS.live_region h r))) )) (ensures (modifies l h h'))
[]
FStar.Modifies.modifies_only_live_regions
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
rs: FStar.Set.set FStar.Monotonic.HyperHeap.rid -> l: FStar.Modifies.loc -> h: FStar.Monotonic.HyperStack.mem -> h': FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Modifies.modifies (FStar.Modifies.loc_union (FStar.Modifies.loc_regions false rs) l) h h' /\ (forall (r: FStar.Monotonic.HyperHeap.rid). FStar.Set.mem r rs ==> ~(FStar.Monotonic.HyperStack.live_region h r))) (ensures FStar.Modifies.modifies l h h')
{ "end_col": 62, "end_line": 310, "start_col": 33, "start_line": 310 }
FStar.Pervasives.Lemma
val region_liveness_insensitive_addresses (preserve_liveness: bool) (r: HS.rid) (a: Set.set nat) : Lemma (region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a)) [SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls
val region_liveness_insensitive_addresses (preserve_liveness: bool) (r: HS.rid) (a: Set.set nat) : Lemma (region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a)) [SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a))] let region_liveness_insensitive_addresses =
false
null
true
MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_includes_region_liveness_insensitive_locs_loc_addresses", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val region_liveness_insensitive_addresses (preserve_liveness: bool) (r: HS.rid) (a: Set.set nat) : Lemma (region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a)) [SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_addresses preserve_liveness r a))]
[]
FStar.Modifies.region_liveness_insensitive_addresses
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
preserve_liveness: Prims.bool -> r: FStar.Monotonic.HyperHeap.rid -> a: FStar.Set.set Prims.nat -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_includes FStar.Modifies.region_liveness_insensitive_locs (FStar.Modifies.loc_addresses preserve_liveness r a)) [ SMTPat (FStar.Modifies.loc_includes FStar.Modifies.region_liveness_insensitive_locs (FStar.Modifies.loc_addresses preserve_liveness r a)) ]
{ "end_col": 68, "end_line": 287, "start_col": 2, "start_line": 287 }
FStar.Pervasives.Lemma
val loc_includes_trans (s1 s2 s3: loc) : Lemma (requires (loc_includes s1 s2 /\ loc_includes s2 s3)) (ensures (loc_includes s1 s3))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes_trans = MG.loc_includes_trans
val loc_includes_trans (s1 s2 s3: loc) : Lemma (requires (loc_includes s1 s2 /\ loc_includes s2 s3)) (ensures (loc_includes s1 s3)) let loc_includes_trans =
false
null
true
MG.loc_includes_trans
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_includes_trans", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes_trans (s1 s2 s3: loc) : Lemma (requires (loc_includes s1 s2 /\ loc_includes s2 s3)) (ensures (loc_includes s1 s3))
[]
FStar.Modifies.loc_includes_trans
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s1: FStar.Modifies.loc -> s2: FStar.Modifies.loc -> s3: FStar.Modifies.loc -> FStar.Pervasives.Lemma (requires FStar.Modifies.loc_includes s1 s2 /\ FStar.Modifies.loc_includes s2 s3) (ensures FStar.Modifies.loc_includes s1 s3)
{ "end_col": 46, "end_line": 210, "start_col": 25, "start_line": 210 }
FStar.Pervasives.Lemma
val does_not_contain_addr_elim (#a: Type0) (#rel: Preorder.preorder a) (r: HS.mreference a rel) (m: HS.mem) (x: HS.rid * nat) : Lemma (requires ( m `does_not_contain_addr` x /\ HS.frameOf r == fst x /\ HS.as_addr r == snd x )) (ensures (~ (m `HS.contains` r)))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let does_not_contain_addr_elim = MG.does_not_contain_addr_elim
val does_not_contain_addr_elim (#a: Type0) (#rel: Preorder.preorder a) (r: HS.mreference a rel) (m: HS.mem) (x: HS.rid * nat) : Lemma (requires ( m `does_not_contain_addr` x /\ HS.frameOf r == fst x /\ HS.as_addr r == snd x )) (ensures (~ (m `HS.contains` r))) let does_not_contain_addr_elim =
false
null
true
MG.does_not_contain_addr_elim
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.does_not_contain_addr_elim" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20" let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) ) #reset-options let modifies_buffer_rcreate_post_common #a r init len b h0 h1 = MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let mreference_live_buffer_unused_in_disjoint #t1 #pre #t2 h b1 b2 = loc_disjoint_includes (loc_freed_mreference b1) (loc_freed_mreference (B.content b2)) (loc_freed_mreference b1) (loc_buffer b2) let buffer_live_mreference_unused_in_disjoint #t1 #t2 #pre h b1 b2 = loc_disjoint_includes (loc_freed_mreference (B.content b1)) (loc_freed_mreference b2) (loc_buffer b1) (loc_freed_mreference b2) let does_not_contain_addr = MG.does_not_contain_addr let not_live_region_does_not_contain_addr = MG.not_live_region_does_not_contain_addr let unused_in_does_not_contain_addr = MG.unused_in_does_not_contain_addr let addr_unused_in_does_not_contain_addr = MG.addr_unused_in_does_not_contain_addr let free_does_not_contain_addr = MG.free_does_not_contain_addr
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val does_not_contain_addr_elim (#a: Type0) (#rel: Preorder.preorder a) (r: HS.mreference a rel) (m: HS.mem) (x: HS.rid * nat) : Lemma (requires ( m `does_not_contain_addr` x /\ HS.frameOf r == fst x /\ HS.as_addr r == snd x )) (ensures (~ (m `HS.contains` r)))
[]
FStar.Modifies.does_not_contain_addr_elim
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
r: FStar.Monotonic.HyperStack.mreference a rel -> m: FStar.Monotonic.HyperStack.mem -> x: (FStar.Monotonic.HyperHeap.rid * Prims.nat) -> FStar.Pervasives.Lemma (requires FStar.Modifies.does_not_contain_addr m x /\ FStar.Monotonic.HyperStack.frameOf r == FStar.Pervasives.Native.fst x /\ FStar.Monotonic.HyperStack.as_addr r == FStar.Pervasives.Native.snd x) (ensures ~(FStar.Monotonic.HyperStack.contains m r))
{ "end_col": 62, "end_line": 428, "start_col": 33, "start_line": 428 }
FStar.Pervasives.Lemma
val no_upd_fresh_region: r:HS.rid -> l:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (HS.fresh_region r h0 h1 /\ modifies (loc_union (loc_all_regions_from false r) l) h0 h1)) (ensures (modifies l h0 h1)) [SMTPat (HS.fresh_region r h0 h1); SMTPat (modifies l h0 h1)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let no_upd_fresh_region = MG.no_upd_fresh_region
val no_upd_fresh_region: r:HS.rid -> l:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (HS.fresh_region r h0 h1 /\ modifies (loc_union (loc_all_regions_from false r) l) h0 h1)) (ensures (modifies l h0 h1)) [SMTPat (HS.fresh_region r h0 h1); SMTPat (modifies l h0 h1)] let no_upd_fresh_region =
false
null
true
MG.no_upd_fresh_region
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.no_upd_fresh_region", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val no_upd_fresh_region: r:HS.rid -> l:loc -> h0:HS.mem -> h1:HS.mem -> Lemma (requires (HS.fresh_region r h0 h1 /\ modifies (loc_union (loc_all_regions_from false r) l) h0 h1)) (ensures (modifies l h0 h1)) [SMTPat (HS.fresh_region r h0 h1); SMTPat (modifies l h0 h1)]
[]
FStar.Modifies.no_upd_fresh_region
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
r: FStar.Monotonic.HyperHeap.rid -> l: FStar.Modifies.loc -> h0: FStar.Monotonic.HyperStack.mem -> h1: FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Monotonic.HyperStack.fresh_region r h0 h1 /\ FStar.Modifies.modifies (FStar.Modifies.loc_union (FStar.Modifies.loc_all_regions_from false r) l) h0 h1) (ensures FStar.Modifies.modifies l h0 h1) [ SMTPat (FStar.Monotonic.HyperStack.fresh_region r h0 h1); SMTPat (FStar.Modifies.modifies l h0 h1) ]
{ "end_col": 48, "end_line": 312, "start_col": 26, "start_line": 312 }
FStar.Pervasives.Lemma
val modifies_loc_addresses_intro (r: HS.rid) (a: Set.set nat) (l: loc) (h1 h2: HS.mem) : Lemma (requires ( HS.live_region h2 r /\ modifies (loc_union (loc_region_only false r) l) h1 h2 /\ HS.modifies_ref r a h1 h2 )) (ensures (modifies (loc_union (loc_addresses true r a) l) h1 h2))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro
val modifies_loc_addresses_intro (r: HS.rid) (a: Set.set nat) (l: loc) (h1 h2: HS.mem) : Lemma (requires ( HS.live_region h2 r /\ modifies (loc_union (loc_region_only false r) l) h1 h2 /\ HS.modifies_ref r a h1 h2 )) (ensures (modifies (loc_union (loc_addresses true r a) l) h1 h2)) let modifies_loc_addresses_intro =
false
null
true
MG.modifies_loc_addresses_intro
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_loc_addresses_intro", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_loc_addresses_intro (r: HS.rid) (a: Set.set nat) (l: loc) (h1 h2: HS.mem) : Lemma (requires ( HS.live_region h2 r /\ modifies (loc_union (loc_region_only false r) l) h1 h2 /\ HS.modifies_ref r a h1 h2 )) (ensures (modifies (loc_union (loc_addresses true r a) l) h1 h2))
[]
FStar.Modifies.modifies_loc_addresses_intro
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
r: FStar.Monotonic.HyperHeap.rid -> a: FStar.Set.set Prims.nat -> l: FStar.Modifies.loc -> h1: FStar.Monotonic.HyperStack.mem -> h2: FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Monotonic.HyperStack.live_region h2 r /\ FStar.Modifies.modifies (FStar.Modifies.loc_union (FStar.Modifies.loc_region_only false r) l ) h1 h2 /\ FStar.Monotonic.HyperStack.modifies_ref r a h1 h2) (ensures FStar.Modifies.modifies (FStar.Modifies.loc_union (FStar.Modifies.loc_addresses true r a) l) h1 h2)
{ "end_col": 66, "end_line": 318, "start_col": 35, "start_line": 318 }
FStar.Pervasives.Lemma
val modifies_only_live_addresses (r: HS.rid) (a: Set.set nat) (l: loc) (h h' : HS.mem) : Lemma (requires ( modifies (loc_union (loc_addresses false r a) l) h h' /\ (forall x . Set.mem x a ==> h `does_not_contain_addr` (r, x)) )) (ensures (modifies l h h'))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_only_live_addresses = MG.modifies_only_live_addresses
val modifies_only_live_addresses (r: HS.rid) (a: Set.set nat) (l: loc) (h h' : HS.mem) : Lemma (requires ( modifies (loc_union (loc_addresses false r a) l) h h' /\ (forall x . Set.mem x a ==> h `does_not_contain_addr` (r, x)) )) (ensures (modifies l h h')) let modifies_only_live_addresses =
false
null
true
MG.modifies_only_live_addresses
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_only_live_addresses", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20" let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) ) #reset-options let modifies_buffer_rcreate_post_common #a r init len b h0 h1 = MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let mreference_live_buffer_unused_in_disjoint #t1 #pre #t2 h b1 b2 = loc_disjoint_includes (loc_freed_mreference b1) (loc_freed_mreference (B.content b2)) (loc_freed_mreference b1) (loc_buffer b2) let buffer_live_mreference_unused_in_disjoint #t1 #t2 #pre h b1 b2 = loc_disjoint_includes (loc_freed_mreference (B.content b1)) (loc_freed_mreference b2) (loc_buffer b1) (loc_freed_mreference b2) let does_not_contain_addr = MG.does_not_contain_addr let not_live_region_does_not_contain_addr = MG.not_live_region_does_not_contain_addr let unused_in_does_not_contain_addr = MG.unused_in_does_not_contain_addr let addr_unused_in_does_not_contain_addr = MG.addr_unused_in_does_not_contain_addr let free_does_not_contain_addr = MG.free_does_not_contain_addr let does_not_contain_addr_elim = MG.does_not_contain_addr_elim
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_only_live_addresses (r: HS.rid) (a: Set.set nat) (l: loc) (h h' : HS.mem) : Lemma (requires ( modifies (loc_union (loc_addresses false r a) l) h h' /\ (forall x . Set.mem x a ==> h `does_not_contain_addr` (r, x)) )) (ensures (modifies l h h'))
[]
FStar.Modifies.modifies_only_live_addresses
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
r: FStar.Monotonic.HyperHeap.rid -> a: FStar.Set.set Prims.nat -> l: FStar.Modifies.loc -> h: FStar.Monotonic.HyperStack.mem -> h': FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Modifies.modifies (FStar.Modifies.loc_union (FStar.Modifies.loc_addresses false r a) l ) h h' /\ (forall (x: Prims.nat). FStar.Set.mem x a ==> FStar.Modifies.does_not_contain_addr h (r, x)) ) (ensures FStar.Modifies.modifies l h h')
{ "end_col": 66, "end_line": 430, "start_col": 35, "start_line": 430 }
FStar.Pervasives.Lemma
val loc_disjoint_buffer_addresses (#t: Type) (p: B.buffer t) (preserve_liveness: bool) (r: HS.rid) (n: Set.set nat) : Lemma (requires (r <> B.frameOf p \/ (~ (Set.mem (B.as_addr p) n)))) (ensures (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n))) [SMTPat (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n
val loc_disjoint_buffer_addresses (#t: Type) (p: B.buffer t) (preserve_liveness: bool) (r: HS.rid) (n: Set.set nat) : Lemma (requires (r <> B.frameOf p \/ (~ (Set.mem (B.as_addr p) n)))) (ensures (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n))) [SMTPat (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n))] let loc_disjoint_buffer_addresses #t p preserve_liveness r n =
false
null
true
MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Buffer.buffer", "Prims.bool", "FStar.Monotonic.HyperHeap.rid", "FStar.Set.set", "Prims.nat", "FStar.ModifiesGen.loc_disjoint_aloc_addresses_intro", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Buffer.frameOf", "FStar.Buffer.as_addr", "FStar.Modifies.LocBuffer", "Prims.unit" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_disjoint_buffer_addresses (#t: Type) (p: B.buffer t) (preserve_liveness: bool) (r: HS.rid) (n: Set.set nat) : Lemma (requires (r <> B.frameOf p \/ (~ (Set.mem (B.as_addr p) n)))) (ensures (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n))) [SMTPat (loc_disjoint (loc_buffer p) (loc_addresses preserve_liveness r n))]
[]
FStar.Modifies.loc_disjoint_buffer_addresses
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
p: FStar.Buffer.buffer t -> preserve_liveness: Prims.bool -> r: FStar.Monotonic.HyperHeap.rid -> n: FStar.Set.set Prims.nat -> FStar.Pervasives.Lemma (requires r <> FStar.Buffer.frameOf p \/ ~(FStar.Set.mem (FStar.Buffer.as_addr p) n)) (ensures FStar.Modifies.loc_disjoint (FStar.Modifies.loc_buffer p) (FStar.Modifies.loc_addresses preserve_liveness r n)) [ SMTPat (FStar.Modifies.loc_disjoint (FStar.Modifies.loc_buffer p) (FStar.Modifies.loc_addresses preserve_liveness r n)) ]
{ "end_col": 112, "end_line": 258, "start_col": 2, "start_line": 258 }
Prims.GTot
val loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b )
val loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 =
false
null
false
match l with | LocBuffer b -> (B.live h1 b) ==> (B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b)
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial" ]
[ "FStar.Modifies.loc_aux", "FStar.Monotonic.HyperStack.mem", "FStar.Buffer.buffer", "Prims.l_imp", "FStar.Buffer.live", "Prims.l_and", "Prims.eq2", "FStar.Seq.Base.seq", "Prims.l_or", "Prims.nat", "FStar.Seq.Base.length", "FStar.Buffer.length", "FStar.Buffer.as_seq" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0
[]
FStar.Modifies.loc_aux_preserved
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l: FStar.Modifies.loc_aux -> h1: FStar.Monotonic.HyperStack.mem -> h2: FStar.Monotonic.HyperStack.mem -> Prims.GTot Type0
{ "end_col": 5, "end_line": 158, "start_col": 2, "start_line": 151 }
FStar.Pervasives.Lemma
val loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3))
[ { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3
val loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) =
false
null
true
match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Modifies.loc_aux", "FStar.Buffer.buffer", "FStar.Modifies.loc_aux_disjoint_buffer_includes", "Prims.unit", "Prims.l_and", "FStar.Modifies.loc_aux_disjoint", "FStar.Modifies.loc_aux_includes_buffer", "Prims.squash", "FStar.Modifies.loc_aux_disjoint_buffer", "Prims.Nil", "FStar.Pervasives.pattern" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3))
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3))
[]
FStar.Modifies.loc_aux_disjoint_loc_aux_includes_buffer
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l1: FStar.Modifies.loc_aux -> l2: FStar.Modifies.loc_aux -> b3: FStar.Buffer.buffer t3 -> FStar.Pervasives.Lemma (requires FStar.Modifies.loc_aux_disjoint l1 l2 /\ FStar.Modifies.loc_aux_includes_buffer l2 b3) (ensures FStar.Modifies.loc_aux_disjoint_buffer l1 b3)
{ "end_col": 61, "end_line": 139, "start_col": 2, "start_line": 138 }
Prims.GTot
val loc_addresses (preserve_liveness: bool) (r: HS.rid) (n: Set.set nat) : GTot loc
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_addresses = MG.loc_addresses
val loc_addresses (preserve_liveness: bool) (r: HS.rid) (n: Set.set nat) : GTot loc let loc_addresses =
false
null
false
MG.loc_addresses
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial" ]
[ "FStar.ModifiesGen.loc_addresses", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_addresses (preserve_liveness: bool) (r: HS.rid) (n: Set.set nat) : GTot loc
[]
FStar.Modifies.loc_addresses
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
preserve_liveness: Prims.bool -> r: FStar.Monotonic.HyperHeap.rid -> n: FStar.Set.set Prims.nat -> Prims.GTot FStar.Modifies.loc
{ "end_col": 36, "end_line": 202, "start_col": 20, "start_line": 202 }
FStar.Pervasives.Lemma
val loc_union_assoc (s1 s2 s3: loc) : Lemma (loc_union s1 (loc_union s2 s3) == loc_union (loc_union s1 s2) s3)
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_union_assoc = MG.loc_union_assoc
val loc_union_assoc (s1 s2 s3: loc) : Lemma (loc_union s1 (loc_union s2 s3) == loc_union (loc_union s1 s2) s3) let loc_union_assoc =
false
null
true
MG.loc_union_assoc
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_union_assoc", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_union_assoc (s1 s2 s3: loc) : Lemma (loc_union s1 (loc_union s2 s3) == loc_union (loc_union s1 s2) s3)
[]
FStar.Modifies.loc_union_assoc
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s1: FStar.Modifies.loc -> s2: FStar.Modifies.loc -> s3: FStar.Modifies.loc -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_union s1 (FStar.Modifies.loc_union s2 s3) == FStar.Modifies.loc_union (FStar.Modifies.loc_union s1 s2) s3)
{ "end_col": 40, "end_line": 193, "start_col": 22, "start_line": 193 }
FStar.Pervasives.Lemma
val loc_union_loc_none_r (s: loc) : Lemma (loc_union s loc_none == s) [SMTPat (loc_union s loc_none)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_union_loc_none_r = MG.loc_union_loc_none_r
val loc_union_loc_none_r (s: loc) : Lemma (loc_union s loc_none == s) [SMTPat (loc_union s loc_none)] let loc_union_loc_none_r =
false
null
true
MG.loc_union_loc_none_r
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_union_loc_none_r", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_union_loc_none_r (s: loc) : Lemma (loc_union s loc_none == s) [SMTPat (loc_union s loc_none)]
[]
FStar.Modifies.loc_union_loc_none_r
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s: FStar.Modifies.loc -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_union s FStar.Modifies.loc_none == s) [SMTPat (FStar.Modifies.loc_union s FStar.Modifies.loc_none)]
{ "end_col": 50, "end_line": 197, "start_col": 27, "start_line": 197 }
Prims.GTot
val loc_disjoint (s1 s2: loc) : GTot Type0
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_disjoint = MG.loc_disjoint
val loc_disjoint (s1 s2: loc) : GTot Type0 let loc_disjoint =
false
null
false
MG.loc_disjoint
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial" ]
[ "FStar.ModifiesGen.loc_disjoint", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_disjoint (s1 s2: loc) : GTot Type0
[]
FStar.Modifies.loc_disjoint
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s1: FStar.Modifies.loc -> s2: FStar.Modifies.loc -> Prims.GTot Type0
{ "end_col": 34, "end_line": 240, "start_col": 19, "start_line": 240 }
Prims.GTot
val modifies (s: loc) (h1 h2: HS.mem) : GTot Type0
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies = MG.modifies
val modifies (s: loc) (h1 h2: HS.mem) : GTot Type0 let modifies =
false
null
false
MG.modifies
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial" ]
[ "FStar.ModifiesGen.modifies", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies (s: loc) (h1 h2: HS.mem) : GTot Type0
[]
FStar.Modifies.modifies
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s: FStar.Modifies.loc -> h1: FStar.Monotonic.HyperStack.mem -> h2: FStar.Monotonic.HyperStack.mem -> Prims.GTot Type0
{ "end_col": 26, "end_line": 262, "start_col": 15, "start_line": 262 }
Prims.Tot
val address_liveness_insensitive_locs: loc
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _
val address_liveness_insensitive_locs: loc let address_liveness_insensitive_locs =
false
null
false
MG.address_liveness_insensitive_locs _
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "total" ]
[ "FStar.ModifiesGen.address_liveness_insensitive_locs", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes
false
true
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val address_liveness_insensitive_locs: loc
[]
FStar.Modifies.address_liveness_insensitive_locs
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
FStar.Modifies.loc
{ "end_col": 78, "end_line": 273, "start_col": 40, "start_line": 273 }
FStar.Pervasives.Lemma
val modifies_2_modifies (#a1 #a2: Type) (b1: B.buffer a1) (b2: B.buffer a2) (h1 h2: HS.mem) : Lemma (requires (B.modifies_2 b1 b2 h1 h2)) (ensures (modifies (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2)) [SMTPat (B.modifies_2 b1 b2 h1 h2)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) )
val modifies_2_modifies (#a1 #a2: Type) (b1: B.buffer a1) (b2: B.buffer a2) (h1 h2: HS.mem) : Lemma (requires (B.modifies_2 b1 b2 h1 h2)) (ensures (modifies (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2)) [SMTPat (B.modifies_2 b1 b2 h1 h2)] let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 =
false
null
true
B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b'))) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2))
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Buffer.buffer", "FStar.Monotonic.HyperStack.mem", "FStar.ModifiesGen.modifies_intro", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Modifies.loc_union", "FStar.Modifies.loc_buffer", "FStar.Monotonic.HyperHeap.rid", "Prims.unit", "FStar.Preorder.preorder", "FStar.Monotonic.HyperStack.mreference", "FStar.ModifiesGen.loc_disjoint_aloc_addresses_elim", "FStar.Buffer.frameOf", "FStar.Buffer.as_addr", "FStar.Modifies.LocBuffer", "FStar.Monotonic.HyperStack.frameOf", "FStar.Set.singleton", "Prims.nat", "FStar.Monotonic.HyperStack.as_addr", "FStar.Modifies.loc_disjoint_sym", "FStar.Modifies.loc_mreference", "FStar.Modifies.loc_disjoint_includes", "FStar.ModifiesGen.loc_disjoint_aloc_elim", "FStar.ModifiesGen.loc_of_aloc", "FStar.Buffer.lemma_reveal_modifies_2" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) )
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_2_modifies (#a1 #a2: Type) (b1: B.buffer a1) (b2: B.buffer a2) (h1 h2: HS.mem) : Lemma (requires (B.modifies_2 b1 b2 h1 h2)) (ensures (modifies (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2)) [SMTPat (B.modifies_2 b1 b2 h1 h2)]
[]
FStar.Modifies.modifies_2_modifies
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
b1: FStar.Buffer.buffer a1 -> b2: FStar.Buffer.buffer a2 -> h1: FStar.Monotonic.HyperStack.mem -> h2: FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Buffer.modifies_2 b1 b2 h1 h2) (ensures FStar.Modifies.modifies (FStar.Modifies.loc_union (FStar.Modifies.loc_buffer b1) (FStar.Modifies.loc_buffer b2)) h1 h2) [SMTPat (FStar.Buffer.modifies_2 b1 b2 h1 h2)]
{ "end_col": 5, "end_line": 374, "start_col": 2, "start_line": 356 }
Prims.GTot
val does_not_contain_addr (h: HS.mem) (ra: HS.rid * nat) : GTot Type0
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let does_not_contain_addr = MG.does_not_contain_addr
val does_not_contain_addr (h: HS.mem) (ra: HS.rid * nat) : GTot Type0 let does_not_contain_addr =
false
null
false
MG.does_not_contain_addr
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "sometrivial" ]
[ "FStar.ModifiesGen.does_not_contain_addr" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20" let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) ) #reset-options let modifies_buffer_rcreate_post_common #a r init len b h0 h1 = MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let mreference_live_buffer_unused_in_disjoint #t1 #pre #t2 h b1 b2 = loc_disjoint_includes (loc_freed_mreference b1) (loc_freed_mreference (B.content b2)) (loc_freed_mreference b1) (loc_buffer b2) let buffer_live_mreference_unused_in_disjoint #t1 #t2 #pre h b1 b2 = loc_disjoint_includes (loc_freed_mreference (B.content b1)) (loc_freed_mreference b2) (loc_buffer b1) (loc_freed_mreference b2)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val does_not_contain_addr (h: HS.mem) (ra: HS.rid * nat) : GTot Type0
[]
FStar.Modifies.does_not_contain_addr
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
h: FStar.Monotonic.HyperStack.mem -> ra: (FStar.Monotonic.HyperHeap.rid * Prims.nat) -> Prims.GTot Type0
{ "end_col": 52, "end_line": 418, "start_col": 28, "start_line": 418 }
FStar.Pervasives.Lemma
val loc_includes_refl (s: loc) : Lemma (loc_includes s s) [SMTPat (loc_includes s s)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes_refl = MG.loc_includes_refl
val loc_includes_refl (s: loc) : Lemma (loc_includes s s) [SMTPat (loc_includes s s)] let loc_includes_refl =
false
null
true
MG.loc_includes_refl
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_includes_refl", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes_refl (s: loc) : Lemma (loc_includes s s) [SMTPat (loc_includes s s)]
[]
FStar.Modifies.loc_includes_refl
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s: FStar.Modifies.loc -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_includes s s) [SMTPat (FStar.Modifies.loc_includes s s)]
{ "end_col": 44, "end_line": 208, "start_col": 24, "start_line": 208 }
Prims.Tot
val cloc_aloc : HS.rid -> nat -> Tot (Type u#1)
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let cloc_aloc = aloc
val cloc_aloc : HS.rid -> nat -> Tot (Type u#1) let cloc_aloc =
false
null
false
aloc
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "total" ]
[ "FStar.Modifies.aloc" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20" let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) ) #reset-options let modifies_buffer_rcreate_post_common #a r init len b h0 h1 = MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let mreference_live_buffer_unused_in_disjoint #t1 #pre #t2 h b1 b2 = loc_disjoint_includes (loc_freed_mreference b1) (loc_freed_mreference (B.content b2)) (loc_freed_mreference b1) (loc_buffer b2) let buffer_live_mreference_unused_in_disjoint #t1 #t2 #pre h b1 b2 = loc_disjoint_includes (loc_freed_mreference (B.content b1)) (loc_freed_mreference b2) (loc_buffer b1) (loc_freed_mreference b2) let does_not_contain_addr = MG.does_not_contain_addr let not_live_region_does_not_contain_addr = MG.not_live_region_does_not_contain_addr let unused_in_does_not_contain_addr = MG.unused_in_does_not_contain_addr let addr_unused_in_does_not_contain_addr = MG.addr_unused_in_does_not_contain_addr let free_does_not_contain_addr = MG.free_does_not_contain_addr let does_not_contain_addr_elim = MG.does_not_contain_addr_elim let modifies_only_live_addresses = MG.modifies_only_live_addresses (* Type class instance *)
false
true
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val cloc_aloc : HS.rid -> nat -> Tot (Type u#1)
[]
FStar.Modifies.cloc_aloc
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
_: FStar.Monotonic.HyperHeap.rid -> _: Prims.nat -> Type
{ "end_col": 20, "end_line": 435, "start_col": 16, "start_line": 435 }
Prims.Tot
val loc_of_cloc (l: MG.loc cloc_cls) : Tot loc
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_of_cloc l = l
val loc_of_cloc (l: MG.loc cloc_cls) : Tot loc let loc_of_cloc l =
false
null
false
l
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "total" ]
[ "FStar.ModifiesGen.loc", "FStar.Modifies.cloc_aloc", "FStar.Modifies.cloc_cls", "FStar.Modifies.loc" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20" let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) ) #reset-options let modifies_buffer_rcreate_post_common #a r init len b h0 h1 = MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let mreference_live_buffer_unused_in_disjoint #t1 #pre #t2 h b1 b2 = loc_disjoint_includes (loc_freed_mreference b1) (loc_freed_mreference (B.content b2)) (loc_freed_mreference b1) (loc_buffer b2) let buffer_live_mreference_unused_in_disjoint #t1 #t2 #pre h b1 b2 = loc_disjoint_includes (loc_freed_mreference (B.content b1)) (loc_freed_mreference b2) (loc_buffer b1) (loc_freed_mreference b2) let does_not_contain_addr = MG.does_not_contain_addr let not_live_region_does_not_contain_addr = MG.not_live_region_does_not_contain_addr let unused_in_does_not_contain_addr = MG.unused_in_does_not_contain_addr let addr_unused_in_does_not_contain_addr = MG.addr_unused_in_does_not_contain_addr let free_does_not_contain_addr = MG.free_does_not_contain_addr let does_not_contain_addr_elim = MG.does_not_contain_addr_elim let modifies_only_live_addresses = MG.modifies_only_live_addresses (* Type class instance *) let cloc_aloc = aloc let cloc_cls = cls let cloc_of_loc l = l
false
true
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_of_cloc (l: MG.loc cloc_cls) : Tot loc
[]
FStar.Modifies.loc_of_cloc
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l: FStar.ModifiesGen.loc FStar.Modifies.cloc_cls -> FStar.Modifies.loc
{ "end_col": 21, "end_line": 441, "start_col": 20, "start_line": 441 }
FStar.Pervasives.Lemma
val loc_includes_union_r (s s1 s2: loc) : Lemma (requires (loc_includes s s1 /\ loc_includes s s2)) (ensures (loc_includes s (loc_union s1 s2))) [SMTPat (loc_includes s (loc_union s1 s2))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes_union_r = MG.loc_includes_union_r
val loc_includes_union_r (s s1 s2: loc) : Lemma (requires (loc_includes s s1 /\ loc_includes s s2)) (ensures (loc_includes s (loc_union s1 s2))) [SMTPat (loc_includes s (loc_union s1 s2))] let loc_includes_union_r =
false
null
true
MG.loc_includes_union_r
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_includes_union_r", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes_union_r (s s1 s2: loc) : Lemma (requires (loc_includes s s1 /\ loc_includes s s2)) (ensures (loc_includes s (loc_union s1 s2))) [SMTPat (loc_includes s (loc_union s1 s2))]
[]
FStar.Modifies.loc_includes_union_r
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s: FStar.Modifies.loc -> s1: FStar.Modifies.loc -> s2: FStar.Modifies.loc -> FStar.Pervasives.Lemma (requires FStar.Modifies.loc_includes s s1 /\ FStar.Modifies.loc_includes s s2) (ensures FStar.Modifies.loc_includes s (FStar.Modifies.loc_union s1 s2)) [SMTPat (FStar.Modifies.loc_includes s (FStar.Modifies.loc_union s1 s2))]
{ "end_col": 50, "end_line": 212, "start_col": 27, "start_line": 212 }
FStar.Pervasives.Lemma
val modifies_3_modifies (#a1 #a2 #a3: Type) (b1: B.buffer a1) (b2: B.buffer a2) (b3: B.buffer a3) (h1 h2: HS.mem) : Lemma (requires (B.modifies_3 b1 b2 b3 h1 h2)) (ensures (modifies (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) )
val modifies_3_modifies (#a1 #a2 #a3: Type) (b1: B.buffer a1) (b2: B.buffer a2) (b3: B.buffer a3) (h1 h2: HS.mem) : Lemma (requires (B.modifies_3 b1 b2 b3 h1 h2)) (ensures (modifies (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2)) let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 =
false
null
true
B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b'))) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3))
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Buffer.buffer", "FStar.Monotonic.HyperStack.mem", "FStar.ModifiesGen.modifies_intro", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Modifies.loc_union", "FStar.Modifies.loc_buffer", "FStar.Monotonic.HyperHeap.rid", "Prims.unit", "FStar.Preorder.preorder", "FStar.Monotonic.HyperStack.mreference", "FStar.ModifiesGen.loc_disjoint_aloc_addresses_elim", "FStar.Buffer.frameOf", "FStar.Buffer.as_addr", "FStar.Modifies.LocBuffer", "FStar.Monotonic.HyperStack.frameOf", "FStar.Set.singleton", "Prims.nat", "FStar.Monotonic.HyperStack.as_addr", "FStar.Modifies.loc_disjoint_sym", "FStar.Modifies.loc_mreference", "FStar.Modifies.loc_disjoint_includes", "FStar.ModifiesGen.loc_disjoint_aloc_elim", "FStar.ModifiesGen.loc_of_aloc", "FStar.Buffer.lemma_reveal_modifies_3" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20"
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 20, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_3_modifies (#a1 #a2 #a3: Type) (b1: B.buffer a1) (b2: B.buffer a2) (b3: B.buffer a3) (h1 h2: HS.mem) : Lemma (requires (B.modifies_3 b1 b2 b3 h1 h2)) (ensures (modifies (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2))
[]
FStar.Modifies.modifies_3_modifies
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
b1: FStar.Buffer.buffer a1 -> b2: FStar.Buffer.buffer a2 -> b3: FStar.Buffer.buffer a3 -> h1: FStar.Monotonic.HyperStack.mem -> h2: FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Buffer.modifies_3 b1 b2 b3 h1 h2) (ensures FStar.Modifies.modifies (FStar.Modifies.loc_union (FStar.Modifies.loc_buffer b1) (FStar.Modifies.loc_union (FStar.Modifies.loc_buffer b2) (FStar.Modifies.loc_buffer b3))) h1 h2)
{ "end_col": 5, "end_line": 402, "start_col": 2, "start_line": 379 }
FStar.Pervasives.Lemma
val loc_includes_none (s: loc) : Lemma (loc_includes s loc_none) [SMTPat (loc_includes s loc_none)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes_none = MG.loc_includes_none
val loc_includes_none (s: loc) : Lemma (loc_includes s loc_none) [SMTPat (loc_includes s loc_none)] let loc_includes_none =
false
null
true
MG.loc_includes_none
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_includes_none", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes_none (s: loc) : Lemma (loc_includes s loc_none) [SMTPat (loc_includes s loc_none)]
[]
FStar.Modifies.loc_includes_none
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s: FStar.Modifies.loc -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_includes s FStar.Modifies.loc_none) [SMTPat (FStar.Modifies.loc_includes s FStar.Modifies.loc_none)]
{ "end_col": 44, "end_line": 216, "start_col": 24, "start_line": 216 }
FStar.Pervasives.Lemma
val loc_includes_buffer (#t: Type) (b1 b2: B.buffer t) : Lemma (requires (b1 `B.includes` b2)) (ensures (loc_includes (loc_buffer b1) (loc_buffer b2))) [SMTPatOr [ [SMTPat (B.includes b1 b2)]; [SMTPat (loc_includes(loc_buffer b1) (loc_buffer b2))] ]]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2)
val loc_includes_buffer (#t: Type) (b1 b2: B.buffer t) : Lemma (requires (b1 `B.includes` b2)) (ensures (loc_includes (loc_buffer b1) (loc_buffer b2))) [SMTPatOr [ [SMTPat (B.includes b1 b2)]; [SMTPat (loc_includes(loc_buffer b1) (loc_buffer b2))] ]] let loc_includes_buffer #t b1 b2 =
false
null
true
MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2)
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Buffer.buffer", "FStar.ModifiesGen.loc_includes_aloc", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Buffer.frameOf", "FStar.Buffer.as_addr", "FStar.Modifies.LocBuffer", "Prims.unit" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes_buffer (#t: Type) (b1 b2: B.buffer t) : Lemma (requires (b1 `B.includes` b2)) (ensures (loc_includes (loc_buffer b1) (loc_buffer b2))) [SMTPatOr [ [SMTPat (B.includes b1 b2)]; [SMTPat (loc_includes(loc_buffer b1) (loc_buffer b2))] ]]
[]
FStar.Modifies.loc_includes_buffer
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
b1: FStar.Buffer.buffer t -> b2: FStar.Buffer.buffer t -> FStar.Pervasives.Lemma (requires FStar.Buffer.includes b1 b2) (ensures FStar.Modifies.loc_includes (FStar.Modifies.loc_buffer b1) (FStar.Modifies.loc_buffer b2)) [ SMTPatOr [ [SMTPat (FStar.Buffer.includes b1 b2)]; [ SMTPat (FStar.Modifies.loc_includes (FStar.Modifies.loc_buffer b1) (FStar.Modifies.loc_buffer b2)) ] ] ]
{ "end_col": 92, "end_line": 219, "start_col": 2, "start_line": 219 }
FStar.Pervasives.Lemma
val loc_includes_gsub_buffer_r (l: loc) (#t: Type) (b: B.buffer t) (i: UInt32.t) (len: UInt32.t) : Lemma (requires (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer b))) (ensures (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer (B.sub b i len)))) [SMTPat (loc_includes l (loc_buffer (B.sub b i len)))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len))
val loc_includes_gsub_buffer_r (l: loc) (#t: Type) (b: B.buffer t) (i: UInt32.t) (len: UInt32.t) : Lemma (requires (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer b))) (ensures (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer (B.sub b i len)))) [SMTPat (loc_includes l (loc_buffer (B.sub b i len)))] let loc_includes_gsub_buffer_r l #t b i len =
false
null
true
loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len))
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Modifies.loc", "FStar.Buffer.buffer", "FStar.UInt32.t", "FStar.Modifies.loc_includes_trans", "FStar.Modifies.loc_buffer", "FStar.Buffer.sub", "Prims.unit" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes_gsub_buffer_r (l: loc) (#t: Type) (b: B.buffer t) (i: UInt32.t) (len: UInt32.t) : Lemma (requires (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer b))) (ensures (UInt32.v i + UInt32.v len <= (B.length b) /\ loc_includes l (loc_buffer (B.sub b i len)))) [SMTPat (loc_includes l (loc_buffer (B.sub b i len)))]
[]
FStar.Modifies.loc_includes_gsub_buffer_r
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l: FStar.Modifies.loc -> b: FStar.Buffer.buffer t -> i: FStar.UInt32.t -> len: FStar.UInt32.t -> FStar.Pervasives.Lemma (requires FStar.UInt32.v i + FStar.UInt32.v len <= FStar.Buffer.length b /\ FStar.Modifies.loc_includes l (FStar.Modifies.loc_buffer b)) (ensures FStar.UInt32.v i + FStar.UInt32.v len <= FStar.Buffer.length b /\ FStar.Modifies.loc_includes l (FStar.Modifies.loc_buffer (FStar.Buffer.sub b i len))) [ SMTPat (FStar.Modifies.loc_includes l (FStar.Modifies.loc_buffer (FStar.Buffer.sub b i len)) ) ]
{ "end_col": 66, "end_line": 222, "start_col": 2, "start_line": 222 }
FStar.Pervasives.Lemma
val loc_includes_region_buffer (#t: Type) (preserve_liveness: bool) (s: Set.set HS.rid) (b: B.buffer t) : Lemma (requires (Set.mem (B.frameOf b) s)) (ensures (loc_includes (loc_regions preserve_liveness s) (loc_buffer b))) [SMTPat (loc_includes (loc_regions preserve_liveness s) (loc_buffer b))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b)
val loc_includes_region_buffer (#t: Type) (preserve_liveness: bool) (s: Set.set HS.rid) (b: B.buffer t) : Lemma (requires (Set.mem (B.frameOf b) s)) (ensures (loc_includes (loc_regions preserve_liveness s) (loc_buffer b))) [SMTPat (loc_includes (loc_regions preserve_liveness s) (loc_buffer b))] let loc_includes_region_buffer #t preserve_liveness s b =
false
null
true
MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b)
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "Prims.bool", "FStar.Set.set", "FStar.Monotonic.HyperHeap.rid", "FStar.Buffer.buffer", "FStar.ModifiesGen.loc_includes_region_aloc", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Buffer.frameOf", "FStar.Buffer.as_addr", "FStar.Modifies.LocBuffer", "Prims.unit" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes_region_buffer (#t: Type) (preserve_liveness: bool) (s: Set.set HS.rid) (b: B.buffer t) : Lemma (requires (Set.mem (B.frameOf b) s)) (ensures (loc_includes (loc_regions preserve_liveness s) (loc_buffer b))) [SMTPat (loc_includes (loc_regions preserve_liveness s) (loc_buffer b))]
[]
FStar.Modifies.loc_includes_region_buffer
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
preserve_liveness: Prims.bool -> s: FStar.Set.set FStar.Monotonic.HyperHeap.rid -> b: FStar.Buffer.buffer t -> FStar.Pervasives.Lemma (requires FStar.Set.mem (FStar.Buffer.frameOf b) s) (ensures FStar.Modifies.loc_includes (FStar.Modifies.loc_regions preserve_liveness s) (FStar.Modifies.loc_buffer b)) [ SMTPat (FStar.Modifies.loc_includes (FStar.Modifies.loc_regions preserve_liveness s) (FStar.Modifies.loc_buffer b)) ]
{ "end_col": 101, "end_line": 230, "start_col": 2, "start_line": 230 }
FStar.Pervasives.Lemma
val loc_disjoint_union_r (s s1 s2: loc) : Lemma (requires (loc_disjoint s s1 /\ loc_disjoint s s2)) (ensures (loc_disjoint s (loc_union s1 s2))) [SMTPat (loc_disjoint s (loc_union s1 s2))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_disjoint_union_r = MG.loc_disjoint_union_r
val loc_disjoint_union_r (s s1 s2: loc) : Lemma (requires (loc_disjoint s s1 /\ loc_disjoint s s2)) (ensures (loc_disjoint s (loc_union s1 s2))) [SMTPat (loc_disjoint s (loc_union s1 s2))] let loc_disjoint_union_r =
false
null
true
MG.loc_disjoint_union_r
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_disjoint_union_r", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_disjoint_union_r (s s1 s2: loc) : Lemma (requires (loc_disjoint s s1 /\ loc_disjoint s s2)) (ensures (loc_disjoint s (loc_union s1 s2))) [SMTPat (loc_disjoint s (loc_union s1 s2))]
[]
FStar.Modifies.loc_disjoint_union_r
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s: FStar.Modifies.loc -> s1: FStar.Modifies.loc -> s2: FStar.Modifies.loc -> FStar.Pervasives.Lemma (requires FStar.Modifies.loc_disjoint s s1 /\ FStar.Modifies.loc_disjoint s s2) (ensures FStar.Modifies.loc_disjoint s (FStar.Modifies.loc_union s1 s2)) [SMTPat (FStar.Modifies.loc_disjoint s (FStar.Modifies.loc_union s1 s2))]
{ "end_col": 50, "end_line": 246, "start_col": 27, "start_line": 246 }
FStar.Pervasives.Lemma
val loc_includes_region_union_l (preserve_liveness: bool) (l: loc) (s1 s2: Set.set HS.rid) : Lemma (requires (loc_includes l (loc_regions preserve_liveness (Set.intersect s2 (Set.complement s1))))) (ensures (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2))) [SMTPat (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes_region_union_l = MG.loc_includes_region_union_l
val loc_includes_region_union_l (preserve_liveness: bool) (l: loc) (s1 s2: Set.set HS.rid) : Lemma (requires (loc_includes l (loc_regions preserve_liveness (Set.intersect s2 (Set.complement s1))))) (ensures (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2))) [SMTPat (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2))] let loc_includes_region_union_l =
false
null
true
MG.loc_includes_region_union_l
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_includes_region_union_l", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes_region_union_l (preserve_liveness: bool) (l: loc) (s1 s2: Set.set HS.rid) : Lemma (requires (loc_includes l (loc_regions preserve_liveness (Set.intersect s2 (Set.complement s1))))) (ensures (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2))) [SMTPat (loc_includes (loc_union (loc_regions preserve_liveness s1) l) (loc_regions preserve_liveness s2))]
[]
FStar.Modifies.loc_includes_region_union_l
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
preserve_liveness: Prims.bool -> l: FStar.Modifies.loc -> s1: FStar.Set.set FStar.Monotonic.HyperHeap.rid -> s2: FStar.Set.set FStar.Monotonic.HyperHeap.rid -> FStar.Pervasives.Lemma (requires FStar.Modifies.loc_includes l (FStar.Modifies.loc_regions preserve_liveness (FStar.Set.intersect s2 (FStar.Set.complement s1)))) (ensures FStar.Modifies.loc_includes (FStar.Modifies.loc_union (FStar.Modifies.loc_regions preserve_liveness s1) l) (FStar.Modifies.loc_regions preserve_liveness s2)) [ SMTPat (FStar.Modifies.loc_includes (FStar.Modifies.loc_union (FStar.Modifies.loc_regions preserve_liveness s1) l) (FStar.Modifies.loc_regions preserve_liveness s2)) ]
{ "end_col": 64, "end_line": 236, "start_col": 34, "start_line": 236 }
FStar.Pervasives.Lemma
val loc_disjoint_includes (p1 p2 p1' p2' : loc) : Lemma (requires (loc_includes p1 p1' /\ loc_includes p2 p2' /\ loc_disjoint p1 p2)) (ensures (loc_disjoint p1' p2')) [SMTPatOr [ [SMTPat (loc_disjoint p1 p2); SMTPat (loc_disjoint p1' p2')]; [SMTPat (loc_includes p1 p1'); SMTPat (loc_includes p2 p2')]; ]]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_disjoint_includes = MG.loc_disjoint_includes
val loc_disjoint_includes (p1 p2 p1' p2' : loc) : Lemma (requires (loc_includes p1 p1' /\ loc_includes p2 p2' /\ loc_disjoint p1 p2)) (ensures (loc_disjoint p1' p2')) [SMTPatOr [ [SMTPat (loc_disjoint p1 p2); SMTPat (loc_disjoint p1' p2')]; [SMTPat (loc_includes p1 p1'); SMTPat (loc_includes p2 p2')]; ]] let loc_disjoint_includes =
false
null
true
MG.loc_disjoint_includes
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_disjoint_includes", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_disjoint_includes (p1 p2 p1' p2' : loc) : Lemma (requires (loc_includes p1 p1' /\ loc_includes p2 p2' /\ loc_disjoint p1 p2)) (ensures (loc_disjoint p1' p2')) [SMTPatOr [ [SMTPat (loc_disjoint p1 p2); SMTPat (loc_disjoint p1' p2')]; [SMTPat (loc_includes p1 p1'); SMTPat (loc_includes p2 p2')]; ]]
[]
FStar.Modifies.loc_disjoint_includes
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
p1: FStar.Modifies.loc -> p2: FStar.Modifies.loc -> p1': FStar.Modifies.loc -> p2': FStar.Modifies.loc -> FStar.Pervasives.Lemma (requires FStar.Modifies.loc_includes p1 p1' /\ FStar.Modifies.loc_includes p2 p2' /\ FStar.Modifies.loc_disjoint p1 p2) (ensures FStar.Modifies.loc_disjoint p1' p2') [ SMTPatOr [ [ SMTPat (FStar.Modifies.loc_disjoint p1 p2); SMTPat (FStar.Modifies.loc_disjoint p1' p2') ]; [ SMTPat (FStar.Modifies.loc_includes p1 p1'); SMTPat (FStar.Modifies.loc_includes p2 p2') ] ] ]
{ "end_col": 52, "end_line": 248, "start_col": 28, "start_line": 248 }
FStar.Pervasives.Lemma
val loc_disjoint_buffer (#t1 #t2: Type) (b1: B.buffer t1) (b2: B.buffer t2) : Lemma (requires (B.disjoint b1 b2)) (ensures (loc_disjoint (loc_buffer b1) (loc_buffer b2))) [SMTPatOr [ [SMTPat (B.disjoint b1 b2)]; [SMTPat (loc_disjoint (loc_buffer b1) (loc_buffer b2))]; ]]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2)
val loc_disjoint_buffer (#t1 #t2: Type) (b1: B.buffer t1) (b2: B.buffer t2) : Lemma (requires (B.disjoint b1 b2)) (ensures (loc_disjoint (loc_buffer b1) (loc_buffer b2))) [SMTPatOr [ [SMTPat (B.disjoint b1 b2)]; [SMTPat (loc_disjoint (loc_buffer b1) (loc_buffer b2))]; ]] let loc_disjoint_buffer #t1 #t2 b1 b2 =
false
null
true
MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2)
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Buffer.buffer", "FStar.ModifiesGen.loc_disjoint_aloc_intro", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Buffer.frameOf", "FStar.Buffer.as_addr", "FStar.Modifies.LocBuffer", "Prims.unit" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_disjoint_buffer (#t1 #t2: Type) (b1: B.buffer t1) (b2: B.buffer t2) : Lemma (requires (B.disjoint b1 b2)) (ensures (loc_disjoint (loc_buffer b1) (loc_buffer b2))) [SMTPatOr [ [SMTPat (B.disjoint b1 b2)]; [SMTPat (loc_disjoint (loc_buffer b1) (loc_buffer b2))]; ]]
[]
FStar.Modifies.loc_disjoint_buffer
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
b1: FStar.Buffer.buffer t1 -> b2: FStar.Buffer.buffer t2 -> FStar.Pervasives.Lemma (requires FStar.Buffer.disjoint b1 b2) (ensures FStar.Modifies.loc_disjoint (FStar.Modifies.loc_buffer b1) (FStar.Modifies.loc_buffer b2)) [ SMTPatOr [ [SMTPat (FStar.Buffer.disjoint b1 b2)]; [ SMTPat (FStar.Modifies.loc_disjoint (FStar.Modifies.loc_buffer b1) (FStar.Modifies.loc_buffer b2)) ] ] ]
{ "end_col": 130, "end_line": 251, "start_col": 2, "start_line": 251 }
Prims.Tot
val region_liveness_insensitive_address_liveness_insensitive: squash (region_liveness_insensitive_locs `loc_includes` address_liveness_insensitive_locs)
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls
val region_liveness_insensitive_address_liveness_insensitive: squash (region_liveness_insensitive_locs `loc_includes` address_liveness_insensitive_locs) let region_liveness_insensitive_address_liveness_insensitive =
false
null
true
MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "total" ]
[ "FStar.ModifiesGen.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls
false
true
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val region_liveness_insensitive_address_liveness_insensitive: squash (region_liveness_insensitive_locs `loc_includes` address_liveness_insensitive_locs)
[]
FStar.Modifies.region_liveness_insensitive_address_liveness_insensitive
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
Prims.squash (FStar.Modifies.loc_includes FStar.Modifies.region_liveness_insensitive_locs FStar.Modifies.address_liveness_insensitive_locs)
{ "end_col": 88, "end_line": 293, "start_col": 2, "start_line": 293 }
FStar.Pervasives.Lemma
val loc_includes_region_addresses (preserve_liveness1: bool) (preserve_liveness2: bool) (s: Set.set HS.rid) (r: HS.rid) (a: Set.set nat) : Lemma (requires (Set.mem r s)) (ensures (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a))) [SMTPat (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls
val loc_includes_region_addresses (preserve_liveness1: bool) (preserve_liveness2: bool) (s: Set.set HS.rid) (r: HS.rid) (a: Set.set nat) : Lemma (requires (Set.mem r s)) (ensures (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a))) [SMTPat (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a))] let loc_includes_region_addresses =
false
null
true
MG.loc_includes_region_addresses #_ #cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_includes_region_addresses", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes_region_addresses (preserve_liveness1: bool) (preserve_liveness2: bool) (s: Set.set HS.rid) (r: HS.rid) (a: Set.set nat) : Lemma (requires (Set.mem r s)) (ensures (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a))) [SMTPat (loc_includes (loc_regions preserve_liveness1 s) (loc_addresses preserve_liveness2 r a))]
[]
FStar.Modifies.loc_includes_region_addresses
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
preserve_liveness1: Prims.bool -> preserve_liveness2: Prims.bool -> s: FStar.Set.set FStar.Monotonic.HyperHeap.rid -> r: FStar.Monotonic.HyperHeap.rid -> a: FStar.Set.set Prims.nat -> FStar.Pervasives.Lemma (requires FStar.Set.mem r s) (ensures FStar.Modifies.loc_includes (FStar.Modifies.loc_regions preserve_liveness1 s) (FStar.Modifies.loc_addresses preserve_liveness2 r a)) [ SMTPat (FStar.Modifies.loc_includes (FStar.Modifies.loc_regions preserve_liveness1 s) (FStar.Modifies.loc_addresses preserve_liveness2 r a)) ]
{ "end_col": 76, "end_line": 232, "start_col": 36, "start_line": 232 }
FStar.Pervasives.Lemma
val modifies_mreference_elim (#t: Type) (#pre: Preorder.preorder t) (b: HS.mreference t pre) (p: loc) (h h': HS.mem) : Lemma (requires ( loc_disjoint (loc_mreference b) p /\ HS.contains h b /\ modifies p h h' )) (ensures ( HS.contains h' b /\ HS.sel h b == HS.sel h' b )) [SMTPatOr [ [ SMTPat (modifies p h h'); SMTPat (HS.sel h b) ] ; [ SMTPat (modifies p h h'); SMTPat (HS.contains h b) ]; [ SMTPat (modifies p h h'); SMTPat (HS.sel h' b) ] ; [ SMTPat (modifies p h h'); SMTPat (HS.contains h' b) ] ] ]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_mreference_elim = MG.modifies_mreference_elim
val modifies_mreference_elim (#t: Type) (#pre: Preorder.preorder t) (b: HS.mreference t pre) (p: loc) (h h': HS.mem) : Lemma (requires ( loc_disjoint (loc_mreference b) p /\ HS.contains h b /\ modifies p h h' )) (ensures ( HS.contains h' b /\ HS.sel h b == HS.sel h' b )) [SMTPatOr [ [ SMTPat (modifies p h h'); SMTPat (HS.sel h b) ] ; [ SMTPat (modifies p h h'); SMTPat (HS.contains h b) ]; [ SMTPat (modifies p h h'); SMTPat (HS.sel h' b) ] ; [ SMTPat (modifies p h h'); SMTPat (HS.contains h' b) ] ] ] let modifies_mreference_elim =
false
null
true
MG.modifies_mreference_elim
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_mreference_elim", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_mreference_elim (#t: Type) (#pre: Preorder.preorder t) (b: HS.mreference t pre) (p: loc) (h h': HS.mem) : Lemma (requires ( loc_disjoint (loc_mreference b) p /\ HS.contains h b /\ modifies p h h' )) (ensures ( HS.contains h' b /\ HS.sel h b == HS.sel h' b )) [SMTPatOr [ [ SMTPat (modifies p h h'); SMTPat (HS.sel h b) ] ; [ SMTPat (modifies p h h'); SMTPat (HS.contains h b) ]; [ SMTPat (modifies p h h'); SMTPat (HS.sel h' b) ] ; [ SMTPat (modifies p h h'); SMTPat (HS.contains h' b) ] ] ]
[]
FStar.Modifies.modifies_mreference_elim
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
b: FStar.Monotonic.HyperStack.mreference t pre -> p: FStar.Modifies.loc -> h: FStar.Monotonic.HyperStack.mem -> h': FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Modifies.loc_disjoint (FStar.Modifies.loc_mreference b) p /\ FStar.Monotonic.HyperStack.contains h b /\ FStar.Modifies.modifies p h h') (ensures FStar.Monotonic.HyperStack.contains h' b /\ FStar.Monotonic.HyperStack.sel h b == FStar.Monotonic.HyperStack.sel h' b) [ SMTPatOr [ [SMTPat (FStar.Modifies.modifies p h h'); SMTPat (FStar.Monotonic.HyperStack.sel h b)]; [ SMTPat (FStar.Modifies.modifies p h h'); SMTPat (FStar.Monotonic.HyperStack.contains h b) ]; [SMTPat (FStar.Modifies.modifies p h h'); SMTPat (FStar.Monotonic.HyperStack.sel h' b)]; [ SMTPat (FStar.Modifies.modifies p h h'); SMTPat (FStar.Monotonic.HyperStack.contains h' b) ] ] ]
{ "end_col": 58, "end_line": 264, "start_col": 31, "start_line": 264 }
FStar.Pervasives.Lemma
val loc_disjoint_regions (preserve_liveness1 preserve_liveness2: bool) (rs1 rs2: Set.set HS.rid) : Lemma (requires (Set.subset (Set.intersect rs1 rs2) Set.empty)) (ensures (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2))) [SMTPat (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls
val loc_disjoint_regions (preserve_liveness1 preserve_liveness2: bool) (rs1 rs2: Set.set HS.rid) : Lemma (requires (Set.subset (Set.intersect rs1 rs2) Set.empty)) (ensures (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2))) [SMTPat (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2))] let loc_disjoint_regions =
false
null
true
MG.loc_disjoint_regions #_ #cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_disjoint_regions", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_disjoint_regions (preserve_liveness1 preserve_liveness2: bool) (rs1 rs2: Set.set HS.rid) : Lemma (requires (Set.subset (Set.intersect rs1 rs2) Set.empty)) (ensures (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2))) [SMTPat (loc_disjoint (loc_regions preserve_liveness1 rs1) (loc_regions preserve_liveness2 rs2))]
[]
FStar.Modifies.loc_disjoint_regions
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
preserve_liveness1: Prims.bool -> preserve_liveness2: Prims.bool -> rs1: FStar.Set.set FStar.Monotonic.HyperHeap.rid -> rs2: FStar.Set.set FStar.Monotonic.HyperHeap.rid -> FStar.Pervasives.Lemma (requires FStar.Set.subset (FStar.Set.intersect rs1 rs2) FStar.Set.empty) (ensures FStar.Modifies.loc_disjoint (FStar.Modifies.loc_regions preserve_liveness1 rs1) (FStar.Modifies.loc_regions preserve_liveness2 rs2)) [ SMTPat (FStar.Modifies.loc_disjoint (FStar.Modifies.loc_regions preserve_liveness1 rs1) (FStar.Modifies.loc_regions preserve_liveness2 rs2)) ]
{ "end_col": 58, "end_line": 260, "start_col": 27, "start_line": 260 }
FStar.Pervasives.Lemma
val modifies_refl (s: loc) (h: HS.mem) : Lemma (modifies s h h) [SMTPat (modifies s h h)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_refl = MG.modifies_refl
val modifies_refl (s: loc) (h: HS.mem) : Lemma (modifies s h h) [SMTPat (modifies s h h)] let modifies_refl =
false
null
true
MG.modifies_refl
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_refl", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h'
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_refl (s: loc) (h: HS.mem) : Lemma (modifies s h h) [SMTPat (modifies s h h)]
[]
FStar.Modifies.modifies_refl
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s: FStar.Modifies.loc -> h: FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (ensures FStar.Modifies.modifies s h h) [SMTPat (FStar.Modifies.modifies s h h)]
{ "end_col": 36, "end_line": 269, "start_col": 20, "start_line": 269 }
FStar.Pervasives.Lemma
val region_liveness_insensitive_regions (rs: Set.set HS.rid) : Lemma (region_liveness_insensitive_locs `loc_includes` (loc_regions true rs)) [SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_regions true rs))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls
val region_liveness_insensitive_regions (rs: Set.set HS.rid) : Lemma (region_liveness_insensitive_locs `loc_includes` (loc_regions true rs)) [SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_regions true rs))] let region_liveness_insensitive_regions =
false
null
true
MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_includes_region_liveness_insensitive_locs_loc_regions", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val region_liveness_insensitive_regions (rs: Set.set HS.rid) : Lemma (region_liveness_insensitive_locs `loc_includes` (loc_regions true rs)) [SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_regions true rs))]
[]
FStar.Modifies.region_liveness_insensitive_regions
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
rs: FStar.Set.set FStar.Monotonic.HyperHeap.rid -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_includes FStar.Modifies.region_liveness_insensitive_locs (FStar.Modifies.loc_regions true rs)) [ SMTPat (FStar.Modifies.loc_includes FStar.Modifies.region_liveness_insensitive_locs (FStar.Modifies.loc_regions true rs)) ]
{ "end_col": 66, "end_line": 290, "start_col": 2, "start_line": 290 }
FStar.Pervasives.Lemma
val loc_includes_addresses_addresses (preserve_liveness1 preserve_liveness2: bool) (r: HS.rid) (s1 s2: Set.set nat) : Lemma (requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1)) (ensures (loc_includes (loc_addresses preserve_liveness1 r s1) (loc_addresses preserve_liveness2 r s2)))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls
val loc_includes_addresses_addresses (preserve_liveness1 preserve_liveness2: bool) (r: HS.rid) (s1 s2: Set.set nat) : Lemma (requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1)) (ensures (loc_includes (loc_addresses preserve_liveness1 r s1) (loc_addresses preserve_liveness2 r s2))) let loc_includes_addresses_addresses =
false
null
true
MG.loc_includes_addresses_addresses #_ cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_includes_addresses_addresses", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes_addresses_addresses (preserve_liveness1 preserve_liveness2: bool) (r: HS.rid) (s1 s2: Set.set nat) : Lemma (requires ((preserve_liveness1 ==> preserve_liveness2) /\ Set.subset s2 s1)) (ensures (loc_includes (loc_addresses preserve_liveness1 r s1) (loc_addresses preserve_liveness2 r s2)))
[]
FStar.Modifies.loc_includes_addresses_addresses
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
preserve_liveness1: Prims.bool -> preserve_liveness2: Prims.bool -> r: FStar.Monotonic.HyperHeap.rid -> s1: FStar.Set.set Prims.nat -> s2: FStar.Set.set Prims.nat -> FStar.Pervasives.Lemma (requires (preserve_liveness1 ==> preserve_liveness2) /\ FStar.Set.subset s2 s1) (ensures FStar.Modifies.loc_includes (FStar.Modifies.loc_addresses preserve_liveness1 r s1) (FStar.Modifies.loc_addresses preserve_liveness2 r s2))
{ "end_col": 81, "end_line": 238, "start_col": 39, "start_line": 238 }
FStar.Pervasives.Lemma
val modifies_ralloc_post (#a: Type) (#rel: Preorder.preorder a) (i: HS.rid) (init: a) (h: HS.mem) (x: HST.mreference a rel { HST.is_eternal_region (HS.frameOf x) } ) (h' : HS.mem) : Lemma (requires (HST.ralloc_post i init h x h')) (ensures (modifies loc_none h h'))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls
val modifies_ralloc_post (#a: Type) (#rel: Preorder.preorder a) (i: HS.rid) (init: a) (h: HS.mem) (x: HST.mreference a rel { HST.is_eternal_region (HS.frameOf x) } ) (h' : HS.mem) : Lemma (requires (HST.ralloc_post i init h x h')) (ensures (modifies loc_none h h')) let modifies_ralloc_post =
false
null
true
MG.modifies_ralloc_post #_ #cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_ralloc_post", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_ralloc_post (#a: Type) (#rel: Preorder.preorder a) (i: HS.rid) (init: a) (h: HS.mem) (x: HST.mreference a rel { HST.is_eternal_region (HS.frameOf x) } ) (h' : HS.mem) : Lemma (requires (HST.ralloc_post i init h x h')) (ensures (modifies loc_none h h'))
[]
FStar.Modifies.modifies_ralloc_post
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
i: FStar.Monotonic.HyperHeap.rid -> init: a -> h: FStar.Monotonic.HyperStack.mem -> x: FStar.HyperStack.ST.mreference a rel {FStar.HyperStack.ST.is_eternal_region (FStar.Monotonic.HyperStack.frameOf x)} -> h': FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.HyperStack.ST.ralloc_post i init h x h') (ensures FStar.Modifies.modifies FStar.Modifies.loc_none h h')
{ "end_col": 58, "end_line": 320, "start_col": 27, "start_line": 320 }
FStar.Pervasives.Lemma
val loc_includes_addresses_buffer (#t: Type) (preserve_liveness: bool) (r: HS.rid) (s: Set.set nat) (p: B.buffer t) : Lemma (requires (B.frameOf p == r /\ Set.mem (B.as_addr p) s)) (ensures (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p))) [SMTPat (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p)
val loc_includes_addresses_buffer (#t: Type) (preserve_liveness: bool) (r: HS.rid) (s: Set.set nat) (p: B.buffer t) : Lemma (requires (B.frameOf p == r /\ Set.mem (B.as_addr p) s)) (ensures (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p))) [SMTPat (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p))] let loc_includes_addresses_buffer #t preserve_liveness r s p =
false
null
true
MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p)
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "Prims.bool", "FStar.Monotonic.HyperHeap.rid", "FStar.Set.set", "Prims.nat", "FStar.Buffer.buffer", "FStar.ModifiesGen.loc_includes_addresses_aloc", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Buffer.as_addr", "FStar.Modifies.LocBuffer", "Prims.unit" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = ()
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_includes_addresses_buffer (#t: Type) (preserve_liveness: bool) (r: HS.rid) (s: Set.set nat) (p: B.buffer t) : Lemma (requires (B.frameOf p == r /\ Set.mem (B.as_addr p) s)) (ensures (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p))) [SMTPat (loc_includes (loc_addresses preserve_liveness r s) (loc_buffer p))]
[]
FStar.Modifies.loc_includes_addresses_buffer
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
preserve_liveness: Prims.bool -> r: FStar.Monotonic.HyperHeap.rid -> s: FStar.Set.set Prims.nat -> p: FStar.Buffer.buffer t -> FStar.Pervasives.Lemma (requires FStar.Buffer.frameOf p == r /\ FStar.Set.mem (FStar.Buffer.as_addr p) s) (ensures FStar.Modifies.loc_includes (FStar.Modifies.loc_addresses preserve_liveness r s) (FStar.Modifies.loc_buffer p)) [ SMTPat (FStar.Modifies.loc_includes (FStar.Modifies.loc_addresses preserve_liveness r s) (FStar.Modifies.loc_buffer p)) ]
{ "end_col": 91, "end_line": 227, "start_col": 2, "start_line": 227 }
FStar.Pervasives.Lemma
val loc_disjoint_addresses (preserve_liveness1 preserve_liveness2: bool) (r1 r2: HS.rid) (n1 n2: Set.set nat) : Lemma (requires (r1 <> r2 \/ Set.subset (Set.intersect n1 n2) Set.empty)) (ensures (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2))) [SMTPat (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls
val loc_disjoint_addresses (preserve_liveness1 preserve_liveness2: bool) (r1 r2: HS.rid) (n1 n2: Set.set nat) : Lemma (requires (r1 <> r2 \/ Set.subset (Set.intersect n1 n2) Set.empty)) (ensures (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2))) [SMTPat (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2))] let loc_disjoint_addresses =
false
null
true
MG.loc_disjoint_addresses #_ #cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_disjoint_addresses", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = ()
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val loc_disjoint_addresses (preserve_liveness1 preserve_liveness2: bool) (r1 r2: HS.rid) (n1 n2: Set.set nat) : Lemma (requires (r1 <> r2 \/ Set.subset (Set.intersect n1 n2) Set.empty)) (ensures (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2))) [SMTPat (loc_disjoint (loc_addresses preserve_liveness1 r1 n1) (loc_addresses preserve_liveness2 r2 n2))]
[]
FStar.Modifies.loc_disjoint_addresses
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
preserve_liveness1: Prims.bool -> preserve_liveness2: Prims.bool -> r1: FStar.Monotonic.HyperHeap.rid -> r2: FStar.Monotonic.HyperHeap.rid -> n1: FStar.Set.set Prims.nat -> n2: FStar.Set.set Prims.nat -> FStar.Pervasives.Lemma (requires r1 <> r2 \/ FStar.Set.subset (FStar.Set.intersect n1 n2) FStar.Set.empty) (ensures FStar.Modifies.loc_disjoint (FStar.Modifies.loc_addresses preserve_liveness1 r1 n1) (FStar.Modifies.loc_addresses preserve_liveness2 r2 n2)) [ SMTPat (FStar.Modifies.loc_disjoint (FStar.Modifies.loc_addresses preserve_liveness1 r1 n1) (FStar.Modifies.loc_addresses preserve_liveness2 r2 n2)) ]
{ "end_col": 62, "end_line": 255, "start_col": 29, "start_line": 255 }
FStar.Pervasives.Lemma
val region_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma (region_liveness_insensitive_locs `loc_includes` (loc_buffer b)) [SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b)
val region_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma (region_liveness_insensitive_locs `loc_includes` (loc_buffer b)) [SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_buffer b))] let region_liveness_insensitive_buffer #t b =
false
null
true
MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b)
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Buffer.buffer", "FStar.ModifiesGen.loc_includes_region_liveness_insensitive_locs_loc_of_aloc", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Buffer.frameOf", "FStar.Buffer.as_addr", "FStar.Modifies.LocBuffer", "Prims.unit" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val region_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma (region_liveness_insensitive_locs `loc_includes` (loc_buffer b)) [SMTPat (region_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
[]
FStar.Modifies.region_liveness_insensitive_buffer
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
b: FStar.Buffer.buffer t -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_includes FStar.Modifies.region_liveness_insensitive_locs (FStar.Modifies.loc_buffer b)) [ SMTPat (FStar.Modifies.loc_includes FStar.Modifies.region_liveness_insensitive_locs (FStar.Modifies.loc_buffer b)) ]
{ "end_col": 113, "end_line": 284, "start_col": 2, "start_line": 284 }
FStar.Pervasives.Lemma
val address_liveness_insensitive_addresses (r: HS.rid) (a: Set.set nat) : Lemma (address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a)) [SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls
val address_liveness_insensitive_addresses (r: HS.rid) (a: Set.set nat) : Lemma (address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a)) [SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a))] let address_liveness_insensitive_addresses =
false
null
true
MG.loc_includes_address_liveness_insensitive_locs_addresses cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.loc_includes_address_liveness_insensitive_locs_addresses", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val address_liveness_insensitive_addresses (r: HS.rid) (a: Set.set nat) : Lemma (address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a)) [SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_addresses true r a))]
[]
FStar.Modifies.address_liveness_insensitive_addresses
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
r: FStar.Monotonic.HyperHeap.rid -> a: FStar.Set.set Prims.nat -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_includes FStar.Modifies.address_liveness_insensitive_locs (FStar.Modifies.loc_addresses true r a)) [ SMTPat (FStar.Modifies.loc_includes FStar.Modifies.address_liveness_insensitive_locs (FStar.Modifies.loc_addresses true r a)) ]
{ "end_col": 65, "end_line": 281, "start_col": 2, "start_line": 281 }
FStar.Pervasives.Lemma
val modifies_trans (s12: loc) (h1 h2: HS.mem) (s23: loc) (h3: HS.mem) : Lemma (requires (modifies s12 h1 h2 /\ modifies s23 h2 h3)) (ensures (modifies (loc_union s12 s23) h1 h3)) [SMTPat (modifies s12 h1 h2); SMTPat (modifies s23 h2 h3)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_trans = MG.modifies_trans
val modifies_trans (s12: loc) (h1 h2: HS.mem) (s23: loc) (h3: HS.mem) : Lemma (requires (modifies s12 h1 h2 /\ modifies s23 h2 h3)) (ensures (modifies (loc_union s12 s23) h1 h3)) [SMTPat (modifies s12 h1 h2); SMTPat (modifies s23 h2 h3)] let modifies_trans =
false
null
true
MG.modifies_trans
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_trans", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_trans (s12: loc) (h1 h2: HS.mem) (s23: loc) (h3: HS.mem) : Lemma (requires (modifies s12 h1 h2 /\ modifies s23 h2 h3)) (ensures (modifies (loc_union s12 s23) h1 h3)) [SMTPat (modifies s12 h1 h2); SMTPat (modifies s23 h2 h3)]
[]
FStar.Modifies.modifies_trans
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
s12: FStar.Modifies.loc -> h1: FStar.Monotonic.HyperStack.mem -> h2: FStar.Monotonic.HyperStack.mem -> s23: FStar.Modifies.loc -> h3: FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Modifies.modifies s12 h1 h2 /\ FStar.Modifies.modifies s23 h2 h3) (ensures FStar.Modifies.modifies (FStar.Modifies.loc_union s12 s23) h1 h3) [SMTPat (FStar.Modifies.modifies s12 h1 h2); SMTPat (FStar.Modifies.modifies s23 h2 h3)]
{ "end_col": 38, "end_line": 308, "start_col": 21, "start_line": 308 }
FStar.Pervasives.Lemma
val modifies_liveness_insensitive_region_buffer (l1 l2 : loc) (h h' : HS.mem) (#t: Type) (x: B.buffer t) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (B.frameOf x))) (ensures (HS.live_region h' (B.frameOf x)))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x)
val modifies_liveness_insensitive_region_buffer (l1 l2 : loc) (h h' : HS.mem) (#t: Type) (x: B.buffer t) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (B.frameOf x))) (ensures (HS.live_region h' (B.frameOf x))) let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x =
false
null
true
MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x)
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Modifies.loc", "FStar.Monotonic.HyperStack.mem", "FStar.Buffer.buffer", "FStar.ModifiesGen.modifies_preserves_region_liveness_aloc", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Buffer.frameOf", "FStar.Buffer.as_addr", "FStar.Modifies.LocBuffer", "Prims.unit" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_liveness_insensitive_region_buffer (l1 l2 : loc) (h h' : HS.mem) (#t: Type) (x: B.buffer t) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_buffer x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (B.frameOf x))) (ensures (HS.live_region h' (B.frameOf x)))
[]
FStar.Modifies.modifies_liveness_insensitive_region_buffer
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l1: FStar.Modifies.loc -> l2: FStar.Modifies.loc -> h: FStar.Monotonic.HyperStack.mem -> h': FStar.Monotonic.HyperStack.mem -> x: FStar.Buffer.buffer t -> FStar.Pervasives.Lemma (requires FStar.Modifies.modifies (FStar.Modifies.loc_union l1 l2) h h' /\ FStar.Modifies.loc_disjoint l1 (FStar.Modifies.loc_buffer x) /\ FStar.Modifies.loc_includes FStar.Modifies.region_liveness_insensitive_locs l2 /\ FStar.Monotonic.HyperStack.live_region h (FStar.Buffer.frameOf x)) (ensures FStar.Monotonic.HyperStack.live_region h' (FStar.Buffer.frameOf x))
{ "end_col": 99, "end_line": 305, "start_col": 2, "start_line": 305 }
FStar.Pervasives.Lemma
val modifies_none_modifies (h1 h2: HS.mem) : Lemma (requires (HST.modifies_none h1 h2)) (ensures (modifies loc_none h1 h2))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_none_modifies = MG.modifies_none_modifies #_ #cls
val modifies_none_modifies (h1 h2: HS.mem) : Lemma (requires (HST.modifies_none h1 h2)) (ensures (modifies loc_none h1 h2)) let modifies_none_modifies =
false
null
true
MG.modifies_none_modifies #_ #cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_none_modifies", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_none_modifies (h1 h2: HS.mem) : Lemma (requires (HST.modifies_none h1 h2)) (ensures (modifies loc_none h1 h2))
[]
FStar.Modifies.modifies_none_modifies
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
h1: FStar.Monotonic.HyperStack.mem -> h2: FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.HyperStack.ST.modifies_none h1 h2) (ensures FStar.Modifies.modifies FStar.Modifies.loc_none h1 h2)
{ "end_col": 62, "end_line": 326, "start_col": 29, "start_line": 326 }
FStar.Pervasives.Lemma
val address_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma (address_liveness_insensitive_locs `loc_includes` (loc_buffer b)) [SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b)
val address_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma (address_liveness_insensitive_locs `loc_includes` (loc_buffer b)) [SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_buffer b))] let address_liveness_insensitive_buffer #t b =
false
null
true
MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b)
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Buffer.buffer", "FStar.ModifiesGen.loc_includes_address_liveness_insensitive_locs_aloc", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Buffer.frameOf", "FStar.Buffer.as_addr", "FStar.Modifies.LocBuffer", "Prims.unit" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val address_liveness_insensitive_buffer (#t: Type) (b: B.buffer t) : Lemma (address_liveness_insensitive_locs `loc_includes` (loc_buffer b)) [SMTPat (address_liveness_insensitive_locs `loc_includes` (loc_buffer b))]
[]
FStar.Modifies.address_liveness_insensitive_buffer
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
b: FStar.Buffer.buffer t -> FStar.Pervasives.Lemma (ensures FStar.Modifies.loc_includes FStar.Modifies.address_liveness_insensitive_locs (FStar.Modifies.loc_buffer b)) [ SMTPat (FStar.Modifies.loc_includes FStar.Modifies.address_liveness_insensitive_locs (FStar.Modifies.loc_buffer b)) ]
{ "end_col": 108, "end_line": 278, "start_col": 2, "start_line": 278 }
FStar.Pervasives.Lemma
val modifies_free (#a: Type) (#rel: Preorder.preorder a) (r: HS.mreference a rel { HS.is_mm r } ) (m: HS.mem { m `HS.contains` r } ) : Lemma (modifies (loc_freed_mreference r) m (HS.free r m))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_free = MG.modifies_free #_ #cls
val modifies_free (#a: Type) (#rel: Preorder.preorder a) (r: HS.mreference a rel { HS.is_mm r } ) (m: HS.mem { m `HS.contains` r } ) : Lemma (modifies (loc_freed_mreference r) m (HS.free r m)) let modifies_free =
false
null
true
MG.modifies_free #_ #cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_free", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_free (#a: Type) (#rel: Preorder.preorder a) (r: HS.mreference a rel { HS.is_mm r } ) (m: HS.mem { m `HS.contains` r } ) : Lemma (modifies (loc_freed_mreference r) m (HS.free r m))
[]
FStar.Modifies.modifies_free
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
r: FStar.Monotonic.HyperStack.mreference a rel {FStar.Monotonic.HyperStack.is_mm r} -> m: FStar.Monotonic.HyperStack.mem{FStar.Monotonic.HyperStack.contains m r} -> FStar.Pervasives.Lemma (ensures FStar.Modifies.modifies (FStar.Modifies.loc_freed_mreference r) m (FStar.Monotonic.HyperStack.free r m))
{ "end_col": 44, "end_line": 324, "start_col": 20, "start_line": 324 }
FStar.Pervasives.Lemma
val modifies_liveness_insensitive_region_mreference (l1 l2 : loc) (h h' : HS.mem) (#t: Type) (#pre: Preorder.preorder t) (x: HS.mreference t pre) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (HS.frameOf x))) (ensures (HS.live_region h' (HS.frameOf x)))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference
val modifies_liveness_insensitive_region_mreference (l1 l2 : loc) (h h' : HS.mem) (#t: Type) (#pre: Preorder.preorder t) (x: HS.mreference t pre) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (HS.frameOf x))) (ensures (HS.live_region h' (HS.frameOf x))) let modifies_liveness_insensitive_region_mreference =
false
null
true
MG.modifies_preserves_region_liveness_reference
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_preserves_region_liveness_reference", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_liveness_insensitive_region_mreference (l1 l2 : loc) (h h' : HS.mem) (#t: Type) (#pre: Preorder.preorder t) (x: HS.mreference t pre) : Lemma (requires (modifies (loc_union l1 l2) h h' /\ loc_disjoint l1 (loc_mreference x) /\ region_liveness_insensitive_locs `loc_includes` l2 /\ HS.live_region h (HS.frameOf x))) (ensures (HS.live_region h' (HS.frameOf x)))
[]
FStar.Modifies.modifies_liveness_insensitive_region_mreference
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
l1: FStar.Modifies.loc -> l2: FStar.Modifies.loc -> h: FStar.Monotonic.HyperStack.mem -> h': FStar.Monotonic.HyperStack.mem -> x: FStar.Monotonic.HyperStack.mreference t pre -> FStar.Pervasives.Lemma (requires FStar.Modifies.modifies (FStar.Modifies.loc_union l1 l2) h h' /\ FStar.Modifies.loc_disjoint l1 (FStar.Modifies.loc_mreference x) /\ FStar.Modifies.loc_includes FStar.Modifies.region_liveness_insensitive_locs l2 /\ FStar.Monotonic.HyperStack.live_region h (FStar.Monotonic.HyperStack.frameOf x)) (ensures FStar.Monotonic.HyperStack.live_region h' (FStar.Monotonic.HyperStack.frameOf x))
{ "end_col": 101, "end_line": 302, "start_col": 54, "start_line": 302 }
FStar.Pervasives.Lemma
val modifies_buffer_none_modifies (h1 h2: HS.mem) : Lemma (requires (B.modifies_none h1 h2)) (ensures (modifies loc_none h1 h2))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ())
val modifies_buffer_none_modifies (h1 h2: HS.mem) : Lemma (requires (B.modifies_none h1 h2)) (ensures (modifies loc_none h1 h2)) let modifies_buffer_none_modifies h1 h2 =
false
null
true
MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ())
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Monotonic.HyperStack.mem", "FStar.ModifiesGen.modifies_none_intro", "FStar.Modifies.aloc", "FStar.Modifies.cls", "FStar.Monotonic.HyperHeap.rid", "Prims.unit", "FStar.Preorder.preorder", "FStar.Monotonic.HyperStack.mreference", "Prims.nat" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_buffer_none_modifies (h1 h2: HS.mem) : Lemma (requires (B.modifies_none h1 h2)) (ensures (modifies loc_none h1 h2))
[]
FStar.Modifies.modifies_buffer_none_modifies
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
h1: FStar.Monotonic.HyperStack.mem -> h2: FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Buffer.modifies_none h1 h2) (ensures FStar.Modifies.modifies FStar.Modifies.loc_none h1 h2)
{ "end_col": 19, "end_line": 332, "start_col": 2, "start_line": 329 }
FStar.Pervasives.Lemma
val not_live_region_does_not_contain_addr (h: HS.mem) (ra: HS.rid * nat) : Lemma (requires (~ (HS.live_region h (fst ra)))) (ensures (h `does_not_contain_addr` ra))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let not_live_region_does_not_contain_addr = MG.not_live_region_does_not_contain_addr
val not_live_region_does_not_contain_addr (h: HS.mem) (ra: HS.rid * nat) : Lemma (requires (~ (HS.live_region h (fst ra)))) (ensures (h `does_not_contain_addr` ra)) let not_live_region_does_not_contain_addr =
false
null
true
MG.not_live_region_does_not_contain_addr
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.not_live_region_does_not_contain_addr" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20" let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) ) #reset-options let modifies_buffer_rcreate_post_common #a r init len b h0 h1 = MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let mreference_live_buffer_unused_in_disjoint #t1 #pre #t2 h b1 b2 = loc_disjoint_includes (loc_freed_mreference b1) (loc_freed_mreference (B.content b2)) (loc_freed_mreference b1) (loc_buffer b2) let buffer_live_mreference_unused_in_disjoint #t1 #t2 #pre h b1 b2 = loc_disjoint_includes (loc_freed_mreference (B.content b1)) (loc_freed_mreference b2) (loc_buffer b1) (loc_freed_mreference b2) let does_not_contain_addr = MG.does_not_contain_addr
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val not_live_region_does_not_contain_addr (h: HS.mem) (ra: HS.rid * nat) : Lemma (requires (~ (HS.live_region h (fst ra)))) (ensures (h `does_not_contain_addr` ra))
[]
FStar.Modifies.not_live_region_does_not_contain_addr
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
h: FStar.Monotonic.HyperStack.mem -> ra: (FStar.Monotonic.HyperHeap.rid * Prims.nat) -> FStar.Pervasives.Lemma (requires ~(FStar.Monotonic.HyperStack.live_region h (FStar.Pervasives.Native.fst ra))) (ensures FStar.Modifies.does_not_contain_addr h ra)
{ "end_col": 84, "end_line": 420, "start_col": 44, "start_line": 420 }
FStar.Pervasives.Lemma
val buffer_live_mreference_unused_in_disjoint (#t1: Type) (#t2: Type) (#pre: Preorder.preorder t2) (h: HS.mem) (b1: B.buffer t1) (b2: HS.mreference t2 pre) : Lemma (requires (B.live h b1 /\ HS.unused_in b2 h)) (ensures (loc_disjoint (loc_buffer b1) (loc_freed_mreference b2))) [SMTPat (B.live h b1); SMTPat (HS.unused_in b2 h)]
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let buffer_live_mreference_unused_in_disjoint #t1 #t2 #pre h b1 b2 = loc_disjoint_includes (loc_freed_mreference (B.content b1)) (loc_freed_mreference b2) (loc_buffer b1) (loc_freed_mreference b2)
val buffer_live_mreference_unused_in_disjoint (#t1: Type) (#t2: Type) (#pre: Preorder.preorder t2) (h: HS.mem) (b1: B.buffer t1) (b2: HS.mreference t2 pre) : Lemma (requires (B.live h b1 /\ HS.unused_in b2 h)) (ensures (loc_disjoint (loc_buffer b1) (loc_freed_mreference b2))) [SMTPat (B.live h b1); SMTPat (HS.unused_in b2 h)] let buffer_live_mreference_unused_in_disjoint #t1 #t2 #pre h b1 b2 =
false
null
true
loc_disjoint_includes (loc_freed_mreference (B.content b1)) (loc_freed_mreference b2) (loc_buffer b1) (loc_freed_mreference b2)
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Preorder.preorder", "FStar.Monotonic.HyperStack.mem", "FStar.Buffer.buffer", "FStar.Monotonic.HyperStack.mreference", "FStar.Modifies.loc_disjoint_includes", "FStar.Modifies.loc_freed_mreference", "FStar.Buffer.lseq", "FStar.Buffer.max_length", "FStar.Heap.trivial_preorder", "FStar.Buffer.content", "FStar.Modifies.loc_buffer", "Prims.unit" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20" let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) ) #reset-options let modifies_buffer_rcreate_post_common #a r init len b h0 h1 = MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let mreference_live_buffer_unused_in_disjoint #t1 #pre #t2 h b1 b2 = loc_disjoint_includes (loc_freed_mreference b1) (loc_freed_mreference (B.content b2)) (loc_freed_mreference b1) (loc_buffer b2)
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val buffer_live_mreference_unused_in_disjoint (#t1: Type) (#t2: Type) (#pre: Preorder.preorder t2) (h: HS.mem) (b1: B.buffer t1) (b2: HS.mreference t2 pre) : Lemma (requires (B.live h b1 /\ HS.unused_in b2 h)) (ensures (loc_disjoint (loc_buffer b1) (loc_freed_mreference b2))) [SMTPat (B.live h b1); SMTPat (HS.unused_in b2 h)]
[]
FStar.Modifies.buffer_live_mreference_unused_in_disjoint
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
h: FStar.Monotonic.HyperStack.mem -> b1: FStar.Buffer.buffer t1 -> b2: FStar.Monotonic.HyperStack.mreference t2 pre -> FStar.Pervasives.Lemma (requires FStar.Buffer.live h b1 /\ FStar.Monotonic.HyperStack.unused_in b2 h) (ensures FStar.Modifies.loc_disjoint (FStar.Modifies.loc_buffer b1) (FStar.Modifies.loc_freed_mreference b2)) [SMTPat (FStar.Buffer.live h b1); SMTPat (FStar.Monotonic.HyperStack.unused_in b2 h)]
{ "end_col": 129, "end_line": 416, "start_col": 2, "start_line": 416 }
FStar.Pervasives.Lemma
val modifies_salloc_post (#a: Type) (#rel: Preorder.preorder a) (init: a) (h: HS.mem) (x: HST.mreference a rel { HS.is_stack_region (HS.frameOf x) } ) (h' : HS.mem) : Lemma (requires (HST.salloc_post init h x h')) (ensures (modifies loc_none h h'))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_salloc_post = MG.modifies_salloc_post #_ #cls
val modifies_salloc_post (#a: Type) (#rel: Preorder.preorder a) (init: a) (h: HS.mem) (x: HST.mreference a rel { HS.is_stack_region (HS.frameOf x) } ) (h' : HS.mem) : Lemma (requires (HST.salloc_post init h x h')) (ensures (modifies loc_none h h')) let modifies_salloc_post =
false
null
true
MG.modifies_salloc_post #_ #cls
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.modifies_salloc_post", "FStar.Modifies.aloc", "FStar.Modifies.cls" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_salloc_post (#a: Type) (#rel: Preorder.preorder a) (init: a) (h: HS.mem) (x: HST.mreference a rel { HS.is_stack_region (HS.frameOf x) } ) (h' : HS.mem) : Lemma (requires (HST.salloc_post init h x h')) (ensures (modifies loc_none h h'))
[]
FStar.Modifies.modifies_salloc_post
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
init: a -> h: FStar.Monotonic.HyperStack.mem -> x: FStar.HyperStack.ST.mreference a rel {FStar.Monotonic.HyperStack.is_stack_region (FStar.Monotonic.HyperStack.frameOf x)} -> h': FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.HyperStack.ST.salloc_post init h x h') (ensures FStar.Modifies.modifies FStar.Modifies.loc_none h h')
{ "end_col": 58, "end_line": 322, "start_col": 27, "start_line": 322 }
FStar.Pervasives.Lemma
val modifies_buffer_rcreate_post_common (#a: Type) (r: HS.rid) (init: a) (len: FStar.UInt32.t) (b: B.buffer a) (h0 h1: HS.mem) : Lemma (requires (B.rcreate_post_common r init len b h0 h1)) (ensures (modifies loc_none h0 h1))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let modifies_buffer_rcreate_post_common #a r init len b h0 h1 = MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ())
val modifies_buffer_rcreate_post_common (#a: Type) (r: HS.rid) (init: a) (len: FStar.UInt32.t) (b: B.buffer a) (h0 h1: HS.mem) : Lemma (requires (B.rcreate_post_common r init len b h0 h1)) (ensures (modifies loc_none h0 h1)) let modifies_buffer_rcreate_post_common #a r init len b h0 h1 =
false
null
true
MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ())
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.Monotonic.HyperHeap.rid", "FStar.UInt32.t", "FStar.Buffer.buffer", "FStar.Monotonic.HyperStack.mem", "FStar.ModifiesGen.modifies_none_intro", "FStar.Modifies.aloc", "FStar.Modifies.cls", "Prims.unit", "FStar.Preorder.preorder", "FStar.Monotonic.HyperStack.mreference", "Prims.nat" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20" let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) ) #reset-options
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val modifies_buffer_rcreate_post_common (#a: Type) (r: HS.rid) (init: a) (len: FStar.UInt32.t) (b: B.buffer a) (h0 h1: HS.mem) : Lemma (requires (B.rcreate_post_common r init len b h0 h1)) (ensures (modifies loc_none h0 h1))
[]
FStar.Modifies.modifies_buffer_rcreate_post_common
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
r: FStar.Monotonic.HyperHeap.rid -> init: a -> len: FStar.UInt32.t -> b: FStar.Buffer.buffer a -> h0: FStar.Monotonic.HyperStack.mem -> h1: FStar.Monotonic.HyperStack.mem -> FStar.Pervasives.Lemma (requires FStar.Buffer.rcreate_post_common r init len b h0 h1) (ensures FStar.Modifies.modifies FStar.Modifies.loc_none h0 h1)
{ "end_col": 19, "end_line": 410, "start_col": 2, "start_line": 407 }
FStar.Pervasives.Lemma
val addr_unused_in_does_not_contain_addr (h: HS.mem) (ra: HS.rid * nat) : Lemma (requires (HS.live_region h (fst ra) ==> snd ra `Heap.addr_unused_in` (Map.sel (HS.get_hmap h) (fst ra)))) (ensures (h `does_not_contain_addr` ra))
[ { "abbrev": true, "full_module": "FStar.ModifiesGen", "short_module": "MG" }, { "abbrev": true, "full_module": "FStar.UInt32", "short_module": "U32" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": true, "full_module": "FStar.Buffer", "short_module": "B" }, { "abbrev": true, "full_module": "FStar.HyperStack.ST", "short_module": "HST" }, { "abbrev": true, "full_module": "FStar.HyperStack", "short_module": "HS" }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null }, { "abbrev": false, "full_module": "FStar.Pervasives", "short_module": null }, { "abbrev": false, "full_module": "Prims", "short_module": null }, { "abbrev": false, "full_module": "FStar", "short_module": null } ]
false
let addr_unused_in_does_not_contain_addr = MG.addr_unused_in_does_not_contain_addr
val addr_unused_in_does_not_contain_addr (h: HS.mem) (ra: HS.rid * nat) : Lemma (requires (HS.live_region h (fst ra) ==> snd ra `Heap.addr_unused_in` (Map.sel (HS.get_hmap h) (fst ra)))) (ensures (h `does_not_contain_addr` ra)) let addr_unused_in_does_not_contain_addr =
false
null
true
MG.addr_unused_in_does_not_contain_addr
{ "checked_file": "FStar.Modifies.fst.checked", "dependencies": [ "prims.fst.checked", "FStar.UInt32.fsti.checked", "FStar.Set.fsti.checked", "FStar.Pervasives.fsti.checked", "FStar.ModifiesGen.fsti.checked", "FStar.HyperStack.ST.fsti.checked", "FStar.HyperStack.fst.checked", "FStar.Classical.fsti.checked", "FStar.Buffer.fst.checked" ], "interface_file": true, "source_file": "FStar.Modifies.fst" }
[ "lemma" ]
[ "FStar.ModifiesGen.addr_unused_in_does_not_contain_addr" ]
[]
(* 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.Modifies module HS = FStar.HyperStack module HST = FStar.HyperStack.ST module B = FStar.Buffer module U32 = FStar.UInt32 noeq type loc_aux : Type = | LocBuffer: (#t: Type) -> (b: B.buffer t) -> loc_aux let loc_aux_in_addr (l: loc_aux) (r: HS.rid) (n: nat) : GTot Type0 = match l with | LocBuffer b -> B.frameOf b == r /\ B.as_addr b == n let aloc (r: HS.rid) (n: nat) : Tot (Type u#1) = (l: loc_aux { loc_aux_in_addr l r n } ) let loc_aux_includes_buffer (#a: Type) (s: loc_aux) (b: B.buffer a) : GTot Type0 = match s with | LocBuffer #a0 b0 -> a == a0 /\ b0 `B.includes` b let loc_aux_includes (s1 s2: loc_aux) : GTot Type0 (decreases s2) = match s2 with | LocBuffer b -> loc_aux_includes_buffer s1 b let loc_aux_includes_refl (s: loc_aux) : Lemma (loc_aux_includes s s) = () let loc_aux_includes_buffer_includes (#a: Type) (s: loc_aux) (b1 b2: B.buffer a) : Lemma (requires (loc_aux_includes_buffer s b1 /\ b1 `B.includes` b2)) (ensures (loc_aux_includes_buffer s b2)) = () let loc_aux_includes_loc_aux_includes_buffer (#a: Type) (s1 s2: loc_aux) (b: B.buffer a) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes_buffer s2 b)) (ensures (loc_aux_includes_buffer s1 b)) = match s2 with | LocBuffer b2 -> loc_aux_includes_buffer_includes s1 b2 b let loc_aux_includes_trans (s1 s2 s3: loc_aux) : Lemma (requires (loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3)) (ensures (loc_aux_includes s1 s3)) = match s3 with | LocBuffer b -> loc_aux_includes_loc_aux_includes_buffer s1 s2 b (* the following is necessary because `decreases` messes up 2nd-order unification with `Classical.forall_intro_3` *) let loc_aux_includes_trans' (s1 s2: loc_aux) (s3: loc_aux) : Lemma ((loc_aux_includes s1 s2 /\ loc_aux_includes s2 s3) ==> loc_aux_includes s1 s3) = Classical.move_requires (loc_aux_includes_trans s1 s2) s3 let loc_aux_disjoint_buffer (l: loc_aux) (#t: Type) (p: B.buffer t) : GTot Type0 = match l with | LocBuffer b -> B.disjoint b p let loc_aux_disjoint (l1 l2: loc_aux) : GTot Type0 = match l2 with | LocBuffer b -> loc_aux_disjoint_buffer l1 b let loc_aux_disjoint_sym (l1 l2: loc_aux) : Lemma (ensures (loc_aux_disjoint l1 l2 <==> loc_aux_disjoint l2 l1)) = () let loc_aux_disjoint_buffer_includes (l: loc_aux) (#t: Type) (p1: B.buffer t) (p2: B.buffer t) : Lemma (requires (loc_aux_disjoint_buffer l p1 /\ p1 `B.includes` p2)) (ensures (loc_aux_disjoint_buffer l p2)) = () let loc_aux_disjoint_loc_aux_includes_buffer (l1 l2: loc_aux) (#t3: Type) (b3: B.buffer t3) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes_buffer l2 b3)) (ensures (loc_aux_disjoint_buffer l1 b3)) = match l2 with | LocBuffer b2 -> loc_aux_disjoint_buffer_includes l1 b2 b3 let loc_aux_disjoint_loc_aux_includes (l1 l2 l3: loc_aux) : Lemma (requires (loc_aux_disjoint l1 l2 /\ loc_aux_includes l2 l3)) (ensures (loc_aux_disjoint l1 l3)) = match l3 with | LocBuffer b3 -> loc_aux_disjoint_loc_aux_includes_buffer l1 l2 b3 let loc_aux_preserved (l: loc_aux) (h1 h2: HS.mem) : GTot Type0 = match l with | LocBuffer b -> ( B.live h1 b ) ==> ( B.live h2 b /\ B.as_seq h2 b == B.as_seq h1 b ) module MG = FStar.ModifiesGen let cls : MG.cls aloc = MG.Cls #aloc (fun #r #a -> loc_aux_includes) (fun #r #a x -> ()) (fun #r #a x1 x2 x3 -> ()) (fun #r #a -> loc_aux_disjoint) (fun #r #a x1 x2 -> ()) (fun #r #a larger1 larger2 smaller1 smaller2 -> ()) (fun #r #a -> loc_aux_preserved) (fun #r #a x h -> ()) (fun #r #a x h1 h2 h3 -> ()) (fun #r #a b h1 h2 f -> match b with | LocBuffer b' -> let g () : Lemma (requires (B.live h1 b')) (ensures (loc_aux_preserved b h1 h2)) = f _ _ (B.content b') in Classical.move_requires g () ) let loc = MG.loc cls let loc_none = MG.loc_none let loc_union = MG.loc_union let loc_union_idem = MG.loc_union_idem let loc_union_comm = MG.loc_union_comm let loc_union_assoc = MG.loc_union_assoc let loc_union_loc_none_l = MG.loc_union_loc_none_l let loc_union_loc_none_r = MG.loc_union_loc_none_r let loc_buffer #t b = MG.loc_of_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_addresses = MG.loc_addresses let loc_regions = MG.loc_regions let loc_includes = MG.loc_includes let loc_includes_refl = MG.loc_includes_refl let loc_includes_trans = MG.loc_includes_trans let loc_includes_union_r = MG.loc_includes_union_r let loc_includes_union_l = MG.loc_includes_union_l let loc_includes_none = MG.loc_includes_none let loc_includes_buffer #t b1 b2 = MG.loc_includes_aloc #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) (LocBuffer b2) let loc_includes_gsub_buffer_r l #t b i len = loc_includes_trans l (loc_buffer b) (loc_buffer (B.sub b i len)) let loc_includes_gsub_buffer_l #t b i1 len1 i2 len2 = () let loc_includes_addresses_buffer #t preserve_liveness r s p = MG.loc_includes_addresses_aloc #_ #cls preserve_liveness r s #(B.as_addr p) (LocBuffer p) let loc_includes_region_buffer #t preserve_liveness s b = MG.loc_includes_region_aloc #_ #cls preserve_liveness s #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let loc_includes_region_addresses = MG.loc_includes_region_addresses #_ #cls let loc_includes_region_region = MG.loc_includes_region_region #_ #cls let loc_includes_region_union_l = MG.loc_includes_region_union_l let loc_includes_addresses_addresses = MG.loc_includes_addresses_addresses #_ cls let loc_disjoint = MG.loc_disjoint let loc_disjoint_sym = MG.loc_disjoint_sym let loc_disjoint_none_r = MG.loc_disjoint_none_r let loc_disjoint_union_r = MG.loc_disjoint_union_r let loc_disjoint_includes = MG.loc_disjoint_includes let loc_disjoint_buffer #t1 #t2 b1 b2 = MG.loc_disjoint_aloc_intro #_ #cls #(B.frameOf b1) #(B.as_addr b1) #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b1) (LocBuffer b2) let loc_disjoint_gsub_buffer #t b i1 len1 i2 len2 = () let loc_disjoint_addresses = MG.loc_disjoint_addresses #_ #cls let loc_disjoint_buffer_addresses #t p preserve_liveness r n = MG.loc_disjoint_aloc_addresses_intro #_ #cls #(B.frameOf p) #(B.as_addr p) (LocBuffer p) preserve_liveness r n let loc_disjoint_regions = MG.loc_disjoint_regions #_ #cls let modifies = MG.modifies let modifies_mreference_elim = MG.modifies_mreference_elim let modifies_buffer_elim #t1 b p h h' = MG.modifies_aloc_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) p h h' let modifies_refl = MG.modifies_refl let modifies_loc_includes = MG.modifies_loc_includes let address_liveness_insensitive_locs = MG.address_liveness_insensitive_locs _ let region_liveness_insensitive_locs = MG.region_liveness_insensitive_locs _ let address_liveness_insensitive_buffer #t b = MG.loc_includes_address_liveness_insensitive_locs_aloc #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let address_liveness_insensitive_addresses = MG.loc_includes_address_liveness_insensitive_locs_addresses cls let region_liveness_insensitive_buffer #t b = MG.loc_includes_region_liveness_insensitive_locs_loc_of_aloc #_ cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) let region_liveness_insensitive_addresses = MG.loc_includes_region_liveness_insensitive_locs_loc_addresses cls let region_liveness_insensitive_regions = MG.loc_includes_region_liveness_insensitive_locs_loc_regions cls let region_liveness_insensitive_address_liveness_insensitive = MG.loc_includes_region_liveness_insensitive_locs_address_liveness_insensitive_locs cls let modifies_liveness_insensitive_mreference = MG.modifies_preserves_liveness let modifies_liveness_insensitive_buffer l1 l2 h h' #t x = MG.modifies_preserves_liveness_strong l1 l2 h h' (B.content x) (LocBuffer x) let modifies_liveness_insensitive_region = MG.modifies_preserves_region_liveness let modifies_liveness_insensitive_region_mreference = MG.modifies_preserves_region_liveness_reference let modifies_liveness_insensitive_region_buffer l1 l2 h h' #t x = MG.modifies_preserves_region_liveness_aloc l1 l2 h h' #(B.frameOf x) #(B.as_addr x) (LocBuffer x) let modifies_trans = MG.modifies_trans let modifies_only_live_regions = MG.modifies_only_live_regions let no_upd_fresh_region = MG.no_upd_fresh_region let modifies_fresh_frame_popped = MG.modifies_fresh_frame_popped let modifies_loc_regions_intro = MG.modifies_loc_regions_intro #_ #cls let modifies_loc_addresses_intro = MG.modifies_loc_addresses_intro let modifies_ralloc_post = MG.modifies_ralloc_post #_ #cls let modifies_salloc_post = MG.modifies_salloc_post #_ #cls let modifies_free = MG.modifies_free #_ #cls let modifies_none_modifies = MG.modifies_none_modifies #_ #cls let modifies_buffer_none_modifies h1 h2 = MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_0_modifies h1 h2 = B.lemma_reveal_modifies_0 h1 h2; MG.modifies_none_intro #_ #cls h1 h2 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let modifies_1_modifies #a b h1 h2 = B.lemma_reveal_modifies_1 b h1 h2; MG.modifies_intro (loc_buffer b) h1 h2 (fun _ -> ()) (fun t' pre' b' -> MG.loc_disjoint_sym (loc_mreference b') (loc_buffer b); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b) #(B.as_addr b) (LocBuffer b) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun t' pre' b' -> ()) (fun r n -> ()) (fun r' a' b' -> MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b) #(B.as_addr b) b' (LocBuffer b) ) let modifies_2_modifies #a1 #a2 b1 b2 h1 h2 = B.lemma_reveal_modifies_2 b1 b2 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_buffer b2)) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_buffer b2)) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_buffer b2)) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2) ) #set-options "--z3rlimit 20" let modifies_3_modifies #a1 #a2 #a3 b1 b2 b3 h1 h2 = B.lemma_reveal_modifies_3 b1 b2 b3 h1 h2; MG.modifies_intro (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) h1 h2 (fun _ -> ()) (fun t' pre' b' -> loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b1); loc_disjoint_sym (loc_mreference b') (loc_buffer b1); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b1) #(B.as_addr b1) (LocBuffer b1) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b2); loc_disjoint_sym (loc_mreference b') (loc_buffer b2); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b2) #(B.as_addr b2) (LocBuffer b2) true (HS.frameOf b') (Set.singleton (HS.as_addr b')); loc_disjoint_includes (loc_mreference b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (loc_mreference b') (loc_buffer b3); loc_disjoint_sym (loc_mreference b') (loc_buffer b3); MG.loc_disjoint_aloc_addresses_elim #_ #cls #(B.frameOf b3) #(B.as_addr b3) (LocBuffer b3) true (HS.frameOf b') (Set.singleton (HS.as_addr b')) ) (fun _ _ _ -> ()) (fun _ _ -> ()) (fun r' a' b' -> loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b1); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b1) #(B.as_addr b1) b' (LocBuffer b1); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b2); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b2) #(B.as_addr b2) b' (LocBuffer b2); loc_disjoint_includes (MG.loc_of_aloc b') (loc_union (loc_buffer b1) (loc_union (loc_buffer b2) (loc_buffer b3))) (MG.loc_of_aloc b') (loc_buffer b3); MG.loc_disjoint_aloc_elim #_ #cls #r' #a' #(B.frameOf b3) #(B.as_addr b3) b' (LocBuffer b3) ) #reset-options let modifies_buffer_rcreate_post_common #a r init len b h0 h1 = MG.modifies_none_intro #_ #cls h0 h1 (fun _ -> ()) (fun _ _ _ -> ()) (fun _ _ -> ()) let mreference_live_buffer_unused_in_disjoint #t1 #pre #t2 h b1 b2 = loc_disjoint_includes (loc_freed_mreference b1) (loc_freed_mreference (B.content b2)) (loc_freed_mreference b1) (loc_buffer b2) let buffer_live_mreference_unused_in_disjoint #t1 #t2 #pre h b1 b2 = loc_disjoint_includes (loc_freed_mreference (B.content b1)) (loc_freed_mreference b2) (loc_buffer b1) (loc_freed_mreference b2) let does_not_contain_addr = MG.does_not_contain_addr let not_live_region_does_not_contain_addr = MG.not_live_region_does_not_contain_addr let unused_in_does_not_contain_addr = MG.unused_in_does_not_contain_addr
false
false
FStar.Modifies.fst
{ "detail_errors": false, "detail_hint_replay": false, "initial_fuel": 2, "initial_ifuel": 1, "max_fuel": 8, "max_ifuel": 2, "no_plugins": false, "no_smt": false, "no_tactics": false, "quake_hi": 1, "quake_keep": false, "quake_lo": 1, "retry": false, "reuse_hint_for": null, "smtencoding_elim_box": false, "smtencoding_l_arith_repr": "boxwrap", "smtencoding_nl_arith_repr": "boxwrap", "smtencoding_valid_elim": false, "smtencoding_valid_intro": true, "tcnorm": true, "trivial_pre_for_unannotated_effectful_fns": true, "z3cliopt": [], "z3refresh": false, "z3rlimit": 5, "z3rlimit_factor": 1, "z3seed": 0, "z3smtopt": [], "z3version": "4.8.5" }
null
val addr_unused_in_does_not_contain_addr (h: HS.mem) (ra: HS.rid * nat) : Lemma (requires (HS.live_region h (fst ra) ==> snd ra `Heap.addr_unused_in` (Map.sel (HS.get_hmap h) (fst ra)))) (ensures (h `does_not_contain_addr` ra))
[]
FStar.Modifies.addr_unused_in_does_not_contain_addr
{ "file_name": "ulib/FStar.Modifies.fst", "git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f", "git_url": "https://github.com/FStarLang/FStar.git", "project_name": "FStar" }
h: FStar.Monotonic.HyperStack.mem -> ra: (FStar.Monotonic.HyperHeap.rid * Prims.nat) -> FStar.Pervasives.Lemma (requires FStar.Monotonic.HyperStack.live_region h (FStar.Pervasives.Native.fst ra) ==> FStar.Monotonic.Heap.addr_unused_in (FStar.Pervasives.Native.snd ra) (FStar.Map.sel (FStar.Monotonic.HyperStack.get_hmap h) (FStar.Pervasives.Native.fst ra))) (ensures FStar.Modifies.does_not_contain_addr h ra)
{ "end_col": 82, "end_line": 424, "start_col": 43, "start_line": 424 }