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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Steel.Effect.Atomic.SteelAtomicUT | val witness_thunk:
#inames: _ ->
#a: Type ->
#pcm: FStar.PCM.pcm a ->
r: PR.ref a pcm ->
fact: M.stable_property pcm ->
v: erased a ->
sq: squash (fact_valid_compat #_ #pcm fact v) ->
unit
-> SteelAtomicUT (PR.witnessed r fact) inames (PR.pts_to r v) (fun _ -> PR.pts_to r v) | [
{
"abbrev": false,
"full_module": "FStar.Real",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Effect.Atomic",
"short_module": "A"
},
{
"abbrev": true,
"full_module": "Steel.GhostPCMReference",
"short_module": "PR"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Steel.Preorder",
"short_module": "Q"
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.GhostPCMReference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let witness_thunk (#inames: _) (#a:Type) (#pcm:FStar.PCM.pcm a)
(r:PR.ref a pcm)
(fact:M.stable_property pcm)
(v:erased a)
(sq:squash (fact_valid_compat #_ #pcm fact v))
(_:unit)
: SteelAtomicUT (PR.witnessed r fact) inames
(PR.pts_to r v)
(fun _ -> PR.pts_to r v)
= witness r fact v sq | val witness_thunk:
#inames: _ ->
#a: Type ->
#pcm: FStar.PCM.pcm a ->
r: PR.ref a pcm ->
fact: M.stable_property pcm ->
v: erased a ->
sq: squash (fact_valid_compat #_ #pcm fact v) ->
unit
-> SteelAtomicUT (PR.witnessed r fact) inames (PR.pts_to r v) (fun _ -> PR.pts_to r v)
let witness_thunk
(#inames: _)
(#a: Type)
(#pcm: FStar.PCM.pcm a)
(r: PR.ref a pcm)
(fact: M.stable_property pcm)
(v: erased a)
(sq: squash (fact_valid_compat #_ #pcm fact v))
(_: unit)
: SteelAtomicUT (PR.witnessed r fact) inames (PR.pts_to r v) (fun _ -> PR.pts_to r v) = | true | null | false | witness r fact v sq | {
"checked_file": "Steel.GhostMonotonicHigherReference.fst.checked",
"dependencies": [
"Steel.Preorder.fst.checked",
"Steel.Memory.fsti.checked",
"Steel.GhostPCMReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.GhostMonotonicHigherReference.fst"
} | [] | [
"Steel.Memory.inames",
"FStar.PCM.pcm",
"Steel.GhostPCMReference.ref",
"Steel.Memory.stable_property",
"FStar.Ghost.erased",
"Prims.squash",
"Steel.Preorder.fact_valid_compat",
"FStar.Ghost.reveal",
"Prims.unit",
"Steel.GhostPCMReference.witness",
"Steel.GhostPCMReference.witnessed",
"Steel.GhostPCMReference.pts_to",
"Steel.Effect.Common.vprop"
] | [] | (*
Copyright 2020 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 Steel.GhostMonotonicHigherReference
open FStar.Ghost
open FStar.PCM
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.GhostPCMReference
open Steel.FractionalPermission
open Steel.Preorder
module Preorder = FStar.Preorder
module Q = Steel.Preorder
module M = Steel.Memory
module PR = Steel.GhostPCMReference
module A = Steel.Effect.Atomic
open FStar.Real
#set-options "--ide_id_info_off"
let ref a p = PR.ref (history a p) pcm_history
[@@__reduce__]
let pts_to_body #a #p (r:ref a p) (f:perm) (v:a) (h:history a p) =
PR.pts_to r h `star`
pure (history_val h v f)
let pts_to' (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v: a) =
h_exists (pts_to_body r f v)
let pts_to_sl r f v = hp_of (pts_to' r f v)
let intro_pure #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to_body r f v h)
= A.intro_pure (history_val h v f)
let intro_pure_full #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to r f v)
= intro_pure #_ #a #p #f r v h;
intro_exists h (pts_to_body r f v)
let alloc #_ (#a:Type) (p:Preorder.preorder a) (v:a)
= let h = Current [v] full_perm in
assert (compatible pcm_history h h);
let x : ref a p = alloc h in
intro_pure_full x v h;
x
let extract_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h)
= elim_pure (history_val h v f);
A.intro_pure (history_val h v f)
let elim_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> PR.pts_to r h)
= let _ = extract_pure r v h in
drop (pure (history_val h v f))
let write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True)
= let h_old_e = witness_exists #_ #_ #(pts_to_body r full_perm v) () in
let _ = elim_pure r v h_old_e in
let h_old = read r in
let h: history a p = extend_history' h_old x in
write r h_old_e h;
intro_pure_full r x h
let witnessed #a #p r fact =
PR.witnessed r (lift_fact fact)
let get_squash (#p:prop) (_:unit{p}) : squash p = ()
let witness_thunk (#inames: _) (#a:Type) (#pcm:FStar.PCM.pcm a)
(r:PR.ref a pcm)
(fact:M.stable_property pcm)
(v:erased a)
(sq:squash (fact_valid_compat #_ #pcm fact v))
(_:unit)
: SteelAtomicUT (PR.witnessed r fact) inames
(PR.pts_to r v) | false | false | Steel.GhostMonotonicHigherReference.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 witness_thunk:
#inames: _ ->
#a: Type ->
#pcm: FStar.PCM.pcm a ->
r: PR.ref a pcm ->
fact: M.stable_property pcm ->
v: erased a ->
sq: squash (fact_valid_compat #_ #pcm fact v) ->
unit
-> SteelAtomicUT (PR.witnessed r fact) inames (PR.pts_to r v) (fun _ -> PR.pts_to r v) | [] | Steel.GhostMonotonicHigherReference.witness_thunk | {
"file_name": "lib/steel/Steel.GhostMonotonicHigherReference.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
r: Steel.GhostPCMReference.ref a pcm ->
fact: Steel.Memory.stable_property pcm ->
v: FStar.Ghost.erased a ->
sq: Prims.squash (Steel.Preorder.fact_valid_compat fact (FStar.Ghost.reveal v)) ->
_: Prims.unit
-> Steel.Effect.Atomic.SteelAtomicUT (Steel.GhostPCMReference.witnessed r fact) | {
"end_col": 23,
"end_line": 126,
"start_col": 4,
"start_line": 126
} |
Steel.Effect.Atomic.SteelGhostT | val elim_pts_to (#o: _) (#a: Type) (#p: Preorder.preorder a) (r: ref a p) (f: perm) (v: a)
: SteelGhostT unit o (pts_to r f v) (fun _ -> pts_to' r f v) | [
{
"abbrev": false,
"full_module": "FStar.Real",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Effect.Atomic",
"short_module": "A"
},
{
"abbrev": true,
"full_module": "Steel.GhostPCMReference",
"short_module": "PR"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Steel.Preorder",
"short_module": "Q"
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.GhostPCMReference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let elim_pts_to #o (#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a)
: SteelGhostT unit o
(pts_to r f v)
(fun _ -> pts_to' r f v)
= rewrite_slprop _ _ (fun _ -> ()) | val elim_pts_to (#o: _) (#a: Type) (#p: Preorder.preorder a) (r: ref a p) (f: perm) (v: a)
: SteelGhostT unit o (pts_to r f v) (fun _ -> pts_to' r f v)
let elim_pts_to #o (#a: Type) (#p: Preorder.preorder a) (r: ref a p) (f: perm) (v: a)
: SteelGhostT unit o (pts_to r f v) (fun _ -> pts_to' r f v) = | true | null | false | rewrite_slprop _ _ (fun _ -> ()) | {
"checked_file": "Steel.GhostMonotonicHigherReference.fst.checked",
"dependencies": [
"Steel.Preorder.fst.checked",
"Steel.Memory.fsti.checked",
"Steel.GhostPCMReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.GhostMonotonicHigherReference.fst"
} | [] | [
"Steel.Memory.inames",
"FStar.Preorder.preorder",
"Steel.GhostMonotonicHigherReference.ref",
"Steel.FractionalPermission.perm",
"Steel.Effect.Atomic.rewrite_slprop",
"Steel.GhostMonotonicHigherReference.pts_to",
"Steel.GhostMonotonicHigherReference.pts_to'",
"Steel.Memory.mem",
"Prims.unit",
"Steel.Effect.Common.vprop"
] | [] | (*
Copyright 2020 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 Steel.GhostMonotonicHigherReference
open FStar.Ghost
open FStar.PCM
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.GhostPCMReference
open Steel.FractionalPermission
open Steel.Preorder
module Preorder = FStar.Preorder
module Q = Steel.Preorder
module M = Steel.Memory
module PR = Steel.GhostPCMReference
module A = Steel.Effect.Atomic
open FStar.Real
#set-options "--ide_id_info_off"
let ref a p = PR.ref (history a p) pcm_history
[@@__reduce__]
let pts_to_body #a #p (r:ref a p) (f:perm) (v:a) (h:history a p) =
PR.pts_to r h `star`
pure (history_val h v f)
let pts_to' (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v: a) =
h_exists (pts_to_body r f v)
let pts_to_sl r f v = hp_of (pts_to' r f v)
let intro_pure #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to_body r f v h)
= A.intro_pure (history_val h v f)
let intro_pure_full #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to r f v)
= intro_pure #_ #a #p #f r v h;
intro_exists h (pts_to_body r f v)
let alloc #_ (#a:Type) (p:Preorder.preorder a) (v:a)
= let h = Current [v] full_perm in
assert (compatible pcm_history h h);
let x : ref a p = alloc h in
intro_pure_full x v h;
x
let extract_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h)
= elim_pure (history_val h v f);
A.intro_pure (history_val h v f)
let elim_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> PR.pts_to r h)
= let _ = extract_pure r v h in
drop (pure (history_val h v f))
let write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True)
= let h_old_e = witness_exists #_ #_ #(pts_to_body r full_perm v) () in
let _ = elim_pure r v h_old_e in
let h_old = read r in
let h: history a p = extend_history' h_old x in
write r h_old_e h;
intro_pure_full r x h
let witnessed #a #p r fact =
PR.witnessed r (lift_fact fact)
let get_squash (#p:prop) (_:unit{p}) : squash p = ()
let witness_thunk (#inames: _) (#a:Type) (#pcm:FStar.PCM.pcm a)
(r:PR.ref a pcm)
(fact:M.stable_property pcm)
(v:erased a)
(sq:squash (fact_valid_compat #_ #pcm fact v))
(_:unit)
: SteelAtomicUT (PR.witnessed r fact) inames
(PR.pts_to r v)
(fun _ -> PR.pts_to r v)
= witness r fact v sq
let witness (#inames: _) (#a:Type) (#q:perm) (#p:Preorder.preorder a)
(r:ref a p)
(fact:stable_property p)
(v:erased a)
(_:squash (fact v))
: SteelAtomicUT (witnessed r fact) inames
(pts_to r q v)
(fun _ -> pts_to r q v)
= let h = witness_exists #_ #_ #(pts_to_body r q v) () in
let _ = elim_pure #_ #_ #_ #q r v h in
assert (forall h'. compatible pcm_history h h' ==> lift_fact fact h');
lift_fact_is_stable #a #p fact;
let w = witness_thunk #_ #_ #(pcm_history #a #p) r (lift_fact fact) h () () in
intro_pure_full r v h;
rewrite_slprop (pts_to _ q _) (pts_to r q v) (fun _ -> ());
return w
let recall (#inames: _) (#a:Type u#1) (#q:perm) (#p:Preorder.preorder a) (fact:property a)
(r:ref a p) (v:erased a) (w:witnessed r fact)
= let h = witness_exists #_ #_ #(pts_to_body r q v) () in
let _ = elim_pure #_ #_ #_ #q r v h in
let h1 = recall (lift_fact fact) r h w in
intro_pure_full r v h;
rewrite_slprop (pts_to _ q _) (pts_to r q v) (fun _ -> ())
let elim_pts_to #o (#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a)
: SteelGhostT unit o
(pts_to r f v) | false | false | Steel.GhostMonotonicHigherReference.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 elim_pts_to (#o: _) (#a: Type) (#p: Preorder.preorder a) (r: ref a p) (f: perm) (v: a)
: SteelGhostT unit o (pts_to r f v) (fun _ -> pts_to' r f v) | [] | Steel.GhostMonotonicHigherReference.elim_pts_to | {
"file_name": "lib/steel/Steel.GhostMonotonicHigherReference.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | r: Steel.GhostMonotonicHigherReference.ref a p -> f: Steel.FractionalPermission.perm -> v: a
-> Steel.Effect.Atomic.SteelGhostT Prims.unit | {
"end_col": 38,
"end_line": 167,
"start_col": 6,
"start_line": 167
} |
Steel.Effect.Atomic.SteelGhostT | val intro_pure_full (#opened #a #p #f: _) (r: ref a p) (v: a) (h: history a p {history_val h v f})
: SteelGhostT unit opened (PR.pts_to r h) (fun _ -> pts_to r f v) | [
{
"abbrev": false,
"full_module": "FStar.Real",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Effect.Atomic",
"short_module": "A"
},
{
"abbrev": true,
"full_module": "Steel.GhostPCMReference",
"short_module": "PR"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Steel.Preorder",
"short_module": "Q"
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.GhostPCMReference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let intro_pure_full #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to r f v)
= intro_pure #_ #a #p #f r v h;
intro_exists h (pts_to_body r f v) | val intro_pure_full (#opened #a #p #f: _) (r: ref a p) (v: a) (h: history a p {history_val h v f})
: SteelGhostT unit opened (PR.pts_to r h) (fun _ -> pts_to r f v)
let intro_pure_full #opened #a #p #f (r: ref a p) (v: a) (h: history a p {history_val h v f})
: SteelGhostT unit opened (PR.pts_to r h) (fun _ -> pts_to r f v) = | true | null | false | intro_pure #_ #a #p #f r v h;
intro_exists h (pts_to_body r f v) | {
"checked_file": "Steel.GhostMonotonicHigherReference.fst.checked",
"dependencies": [
"Steel.Preorder.fst.checked",
"Steel.Memory.fsti.checked",
"Steel.GhostPCMReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.GhostMonotonicHigherReference.fst"
} | [] | [
"Steel.Memory.inames",
"FStar.Preorder.preorder",
"Steel.FractionalPermission.perm",
"Steel.GhostMonotonicHigherReference.ref",
"Steel.Preorder.history",
"Steel.Preorder.history_val",
"FStar.Ghost.hide",
"Steel.Effect.Atomic.intro_exists",
"Steel.GhostMonotonicHigherReference.pts_to_body",
"Prims.unit",
"Steel.GhostMonotonicHigherReference.intro_pure",
"Steel.GhostPCMReference.pts_to",
"Steel.Preorder.pcm_history",
"Steel.GhostMonotonicHigherReference.pts_to",
"Steel.Effect.Common.vprop"
] | [] | (*
Copyright 2020 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 Steel.GhostMonotonicHigherReference
open FStar.Ghost
open FStar.PCM
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.GhostPCMReference
open Steel.FractionalPermission
open Steel.Preorder
module Preorder = FStar.Preorder
module Q = Steel.Preorder
module M = Steel.Memory
module PR = Steel.GhostPCMReference
module A = Steel.Effect.Atomic
open FStar.Real
#set-options "--ide_id_info_off"
let ref a p = PR.ref (history a p) pcm_history
[@@__reduce__]
let pts_to_body #a #p (r:ref a p) (f:perm) (v:a) (h:history a p) =
PR.pts_to r h `star`
pure (history_val h v f)
let pts_to' (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v: a) =
h_exists (pts_to_body r f v)
let pts_to_sl r f v = hp_of (pts_to' r f v)
let intro_pure #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to_body r f v h)
= A.intro_pure (history_val h v f)
let intro_pure_full #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h) | false | false | Steel.GhostMonotonicHigherReference.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 intro_pure_full (#opened #a #p #f: _) (r: ref a p) (v: a) (h: history a p {history_val h v f})
: SteelGhostT unit opened (PR.pts_to r h) (fun _ -> pts_to r f v) | [] | Steel.GhostMonotonicHigherReference.intro_pure_full | {
"file_name": "lib/steel/Steel.GhostMonotonicHigherReference.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
r: Steel.GhostMonotonicHigherReference.ref a p ->
v: a ->
h: Steel.Preorder.history a p {Steel.Preorder.history_val h (FStar.Ghost.hide v) f}
-> Steel.Effect.Atomic.SteelGhostT Prims.unit | {
"end_col": 38,
"end_line": 66,
"start_col": 4,
"start_line": 65
} |
Steel.Effect.Atomic.SteelGhostT | val alloc (#opened: _) (#a:Type) (p:Preorder.preorder a) (v:a)
: SteelGhostT (ref a p) opened emp (fun r -> pts_to r full_perm v) | [
{
"abbrev": false,
"full_module": "FStar.Real",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Effect.Atomic",
"short_module": "A"
},
{
"abbrev": true,
"full_module": "Steel.GhostPCMReference",
"short_module": "PR"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Steel.Preorder",
"short_module": "Q"
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.GhostPCMReference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let alloc #_ (#a:Type) (p:Preorder.preorder a) (v:a)
= let h = Current [v] full_perm in
assert (compatible pcm_history h h);
let x : ref a p = alloc h in
intro_pure_full x v h;
x | val alloc (#opened: _) (#a:Type) (p:Preorder.preorder a) (v:a)
: SteelGhostT (ref a p) opened emp (fun r -> pts_to r full_perm v)
let alloc #_ (#a: Type) (p: Preorder.preorder a) (v: a) = | true | null | false | let h = Current [v] full_perm in
assert (compatible pcm_history h h);
let x:ref a p = alloc h in
intro_pure_full x v h;
x | {
"checked_file": "Steel.GhostMonotonicHigherReference.fst.checked",
"dependencies": [
"Steel.Preorder.fst.checked",
"Steel.Memory.fsti.checked",
"Steel.GhostPCMReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.GhostMonotonicHigherReference.fst"
} | [] | [
"Steel.Memory.inames",
"FStar.Preorder.preorder",
"Steel.GhostMonotonicHigherReference.ref",
"Prims.unit",
"Steel.GhostMonotonicHigherReference.intro_pure_full",
"Steel.FractionalPermission.full_perm",
"Steel.GhostPCMReference.alloc",
"Steel.Preorder.history",
"Steel.Preorder.pcm_history",
"Steel.GhostPCMReference.ref",
"Prims._assert",
"FStar.PCM.compatible",
"Steel.Preorder.Current",
"Prims.Cons",
"Prims.Nil"
] | [] | (*
Copyright 2020 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 Steel.GhostMonotonicHigherReference
open FStar.Ghost
open FStar.PCM
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.GhostPCMReference
open Steel.FractionalPermission
open Steel.Preorder
module Preorder = FStar.Preorder
module Q = Steel.Preorder
module M = Steel.Memory
module PR = Steel.GhostPCMReference
module A = Steel.Effect.Atomic
open FStar.Real
#set-options "--ide_id_info_off"
let ref a p = PR.ref (history a p) pcm_history
[@@__reduce__]
let pts_to_body #a #p (r:ref a p) (f:perm) (v:a) (h:history a p) =
PR.pts_to r h `star`
pure (history_val h v f)
let pts_to' (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v: a) =
h_exists (pts_to_body r f v)
let pts_to_sl r f v = hp_of (pts_to' r f v)
let intro_pure #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to_body r f v h)
= A.intro_pure (history_val h v f)
let intro_pure_full #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to r f v)
= intro_pure #_ #a #p #f r v h;
intro_exists h (pts_to_body r f v) | false | false | Steel.GhostMonotonicHigherReference.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 alloc (#opened: _) (#a:Type) (p:Preorder.preorder a) (v:a)
: SteelGhostT (ref a p) opened emp (fun r -> pts_to r full_perm v) | [] | Steel.GhostMonotonicHigherReference.alloc | {
"file_name": "lib/steel/Steel.GhostMonotonicHigherReference.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p: FStar.Preorder.preorder a -> v: a
-> Steel.Effect.Atomic.SteelGhostT (Steel.GhostMonotonicHigherReference.ref a p) | {
"end_col": 5,
"end_line": 73,
"start_col": 3,
"start_line": 69
} |
Steel.Effect.Atomic.SteelGhostT | val elim_pure (#a #uses #p #f: _) (r: ref a p) (v: a) (h: (history a p))
: SteelGhostT (_: unit{history_val h v f}) uses (pts_to_body r f v h) (fun _ -> PR.pts_to r h) | [
{
"abbrev": false,
"full_module": "FStar.Real",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Effect.Atomic",
"short_module": "A"
},
{
"abbrev": true,
"full_module": "Steel.GhostPCMReference",
"short_module": "PR"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Steel.Preorder",
"short_module": "Q"
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.GhostPCMReference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let elim_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> PR.pts_to r h)
= let _ = extract_pure r v h in
drop (pure (history_val h v f)) | val elim_pure (#a #uses #p #f: _) (r: ref a p) (v: a) (h: (history a p))
: SteelGhostT (_: unit{history_val h v f}) uses (pts_to_body r f v h) (fun _ -> PR.pts_to r h)
let elim_pure #a #uses #p #f (r: ref a p) (v: a) (h: (history a p))
: SteelGhostT (_: unit{history_val h v f}) uses (pts_to_body r f v h) (fun _ -> PR.pts_to r h) = | true | null | false | let _ = extract_pure r v h in
drop (pure (history_val h v f)) | {
"checked_file": "Steel.GhostMonotonicHigherReference.fst.checked",
"dependencies": [
"Steel.Preorder.fst.checked",
"Steel.Memory.fsti.checked",
"Steel.GhostPCMReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.GhostMonotonicHigherReference.fst"
} | [] | [
"Steel.Memory.inames",
"FStar.Preorder.preorder",
"Steel.FractionalPermission.perm",
"Steel.GhostMonotonicHigherReference.ref",
"Steel.Preorder.history",
"Steel.Effect.Atomic.drop",
"Steel.Effect.Common.pure",
"Steel.Preorder.history_val",
"FStar.Ghost.hide",
"Prims.unit",
"Steel.GhostMonotonicHigherReference.extract_pure",
"Steel.GhostMonotonicHigherReference.pts_to_body",
"Steel.GhostPCMReference.pts_to",
"Steel.Preorder.pcm_history",
"Steel.Effect.Common.vprop"
] | [] | (*
Copyright 2020 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 Steel.GhostMonotonicHigherReference
open FStar.Ghost
open FStar.PCM
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.GhostPCMReference
open Steel.FractionalPermission
open Steel.Preorder
module Preorder = FStar.Preorder
module Q = Steel.Preorder
module M = Steel.Memory
module PR = Steel.GhostPCMReference
module A = Steel.Effect.Atomic
open FStar.Real
#set-options "--ide_id_info_off"
let ref a p = PR.ref (history a p) pcm_history
[@@__reduce__]
let pts_to_body #a #p (r:ref a p) (f:perm) (v:a) (h:history a p) =
PR.pts_to r h `star`
pure (history_val h v f)
let pts_to' (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v: a) =
h_exists (pts_to_body r f v)
let pts_to_sl r f v = hp_of (pts_to' r f v)
let intro_pure #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to_body r f v h)
= A.intro_pure (history_val h v f)
let intro_pure_full #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to r f v)
= intro_pure #_ #a #p #f r v h;
intro_exists h (pts_to_body r f v)
let alloc #_ (#a:Type) (p:Preorder.preorder a) (v:a)
= let h = Current [v] full_perm in
assert (compatible pcm_history h h);
let x : ref a p = alloc h in
intro_pure_full x v h;
x
let extract_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h)
= elim_pure (history_val h v f);
A.intro_pure (history_val h v f)
let elim_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h) | false | false | Steel.GhostMonotonicHigherReference.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 elim_pure (#a #uses #p #f: _) (r: ref a p) (v: a) (h: (history a p))
: SteelGhostT (_: unit{history_val h v f}) uses (pts_to_body r f v h) (fun _ -> PR.pts_to r h) | [] | Steel.GhostMonotonicHigherReference.elim_pure | {
"file_name": "lib/steel/Steel.GhostMonotonicHigherReference.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | r: Steel.GhostMonotonicHigherReference.ref a p -> v: a -> h: Steel.Preorder.history a p
-> Steel.Effect.Atomic.SteelGhostT
(_: Prims.unit{Steel.Preorder.history_val h (FStar.Ghost.hide v) f}) | {
"end_col": 35,
"end_line": 95,
"start_col": 3,
"start_line": 94
} |
Steel.Effect.Atomic.SteelGhostT | val extract_pure (#a #uses #p #f: _) (r: ref a p) (v: a) (h: (history a p))
: SteelGhostT (_: unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h) | [
{
"abbrev": false,
"full_module": "FStar.Real",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Effect.Atomic",
"short_module": "A"
},
{
"abbrev": true,
"full_module": "Steel.GhostPCMReference",
"short_module": "PR"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Steel.Preorder",
"short_module": "Q"
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.GhostPCMReference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let extract_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h)
= elim_pure (history_val h v f);
A.intro_pure (history_val h v f) | val extract_pure (#a #uses #p #f: _) (r: ref a p) (v: a) (h: (history a p))
: SteelGhostT (_: unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h)
let extract_pure #a #uses #p #f (r: ref a p) (v: a) (h: (history a p))
: SteelGhostT (_: unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h) = | true | null | false | elim_pure (history_val h v f);
A.intro_pure (history_val h v f) | {
"checked_file": "Steel.GhostMonotonicHigherReference.fst.checked",
"dependencies": [
"Steel.Preorder.fst.checked",
"Steel.Memory.fsti.checked",
"Steel.GhostPCMReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.GhostMonotonicHigherReference.fst"
} | [] | [
"Steel.Memory.inames",
"FStar.Preorder.preorder",
"Steel.FractionalPermission.perm",
"Steel.GhostMonotonicHigherReference.ref",
"Steel.Preorder.history",
"Steel.Effect.Atomic.intro_pure",
"Steel.Preorder.history_val",
"FStar.Ghost.hide",
"Prims.unit",
"Steel.Effect.Atomic.elim_pure",
"Steel.GhostMonotonicHigherReference.pts_to_body",
"Steel.Effect.Common.vprop"
] | [] | (*
Copyright 2020 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 Steel.GhostMonotonicHigherReference
open FStar.Ghost
open FStar.PCM
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.GhostPCMReference
open Steel.FractionalPermission
open Steel.Preorder
module Preorder = FStar.Preorder
module Q = Steel.Preorder
module M = Steel.Memory
module PR = Steel.GhostPCMReference
module A = Steel.Effect.Atomic
open FStar.Real
#set-options "--ide_id_info_off"
let ref a p = PR.ref (history a p) pcm_history
[@@__reduce__]
let pts_to_body #a #p (r:ref a p) (f:perm) (v:a) (h:history a p) =
PR.pts_to r h `star`
pure (history_val h v f)
let pts_to' (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v: a) =
h_exists (pts_to_body r f v)
let pts_to_sl r f v = hp_of (pts_to' r f v)
let intro_pure #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to_body r f v h)
= A.intro_pure (history_val h v f)
let intro_pure_full #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to r f v)
= intro_pure #_ #a #p #f r v h;
intro_exists h (pts_to_body r f v)
let alloc #_ (#a:Type) (p:Preorder.preorder a) (v:a)
= let h = Current [v] full_perm in
assert (compatible pcm_history h h);
let x : ref a p = alloc h in
intro_pure_full x v h;
x
let extract_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h) | false | false | Steel.GhostMonotonicHigherReference.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 extract_pure (#a #uses #p #f: _) (r: ref a p) (v: a) (h: (history a p))
: SteelGhostT (_: unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h) | [] | Steel.GhostMonotonicHigherReference.extract_pure | {
"file_name": "lib/steel/Steel.GhostMonotonicHigherReference.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | r: Steel.GhostMonotonicHigherReference.ref a p -> v: a -> h: Steel.Preorder.history a p
-> Steel.Effect.Atomic.SteelGhostT
(_: Prims.unit{Steel.Preorder.history_val h (FStar.Ghost.hide v) f}) | {
"end_col": 36,
"end_line": 84,
"start_col": 4,
"start_line": 83
} |
Steel.Effect.Atomic.SteelAtomicU | val recall (#inames: _) (#a:Type u#1) (#q:perm) (#p:Preorder.preorder a)
(fact:property a)
(r:ref a p)
(v:erased a)
(w:witnessed r fact)
: SteelAtomicU unit inames
(pts_to r q v)
(fun _ -> pts_to r q v)
(requires fun _ -> True)
(ensures fun _ _ _ -> fact v) | [
{
"abbrev": false,
"full_module": "FStar.Real",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Effect.Atomic",
"short_module": "A"
},
{
"abbrev": true,
"full_module": "Steel.GhostPCMReference",
"short_module": "PR"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Steel.Preorder",
"short_module": "Q"
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.GhostPCMReference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let recall (#inames: _) (#a:Type u#1) (#q:perm) (#p:Preorder.preorder a) (fact:property a)
(r:ref a p) (v:erased a) (w:witnessed r fact)
= let h = witness_exists #_ #_ #(pts_to_body r q v) () in
let _ = elim_pure #_ #_ #_ #q r v h in
let h1 = recall (lift_fact fact) r h w in
intro_pure_full r v h;
rewrite_slprop (pts_to _ q _) (pts_to r q v) (fun _ -> ()) | val recall (#inames: _) (#a:Type u#1) (#q:perm) (#p:Preorder.preorder a)
(fact:property a)
(r:ref a p)
(v:erased a)
(w:witnessed r fact)
: SteelAtomicU unit inames
(pts_to r q v)
(fun _ -> pts_to r q v)
(requires fun _ -> True)
(ensures fun _ _ _ -> fact v)
let recall
(#inames: _)
(#a: Type u#1)
(#q: perm)
(#p: Preorder.preorder a)
(fact: property a)
(r: ref a p)
(v: erased a)
(w: witnessed r fact)
= | true | null | false | let h = witness_exists #_ #_ #(pts_to_body r q v) () in
let _ = elim_pure #_ #_ #_ #q r v h in
let h1 = recall (lift_fact fact) r h w in
intro_pure_full r v h;
rewrite_slprop (pts_to _ q _) (pts_to r q v) (fun _ -> ()) | {
"checked_file": "Steel.GhostMonotonicHigherReference.fst.checked",
"dependencies": [
"Steel.Preorder.fst.checked",
"Steel.Memory.fsti.checked",
"Steel.GhostPCMReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.GhostMonotonicHigherReference.fst"
} | [] | [
"Steel.Memory.inames",
"Steel.FractionalPermission.perm",
"FStar.Preorder.preorder",
"Steel.GhostMonotonicHigherReference.property",
"Steel.GhostMonotonicHigherReference.ref",
"FStar.Ghost.erased",
"Steel.GhostMonotonicHigherReference.witnessed",
"Steel.Effect.Atomic.rewrite_slprop",
"Steel.GhostMonotonicHigherReference.pts_to",
"FStar.Ghost.reveal",
"Steel.Memory.mem",
"Prims.unit",
"Steel.GhostMonotonicHigherReference.intro_pure_full",
"Steel.Preorder.history",
"Steel.GhostPCMReference.recall",
"Steel.Preorder.pcm_history",
"Steel.Preorder.lift_fact",
"Steel.Preorder.history_val",
"FStar.Ghost.hide",
"Steel.GhostMonotonicHigherReference.elim_pure",
"Steel.Effect.Atomic.witness_exists",
"Steel.GhostMonotonicHigherReference.pts_to_body"
] | [] | (*
Copyright 2020 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 Steel.GhostMonotonicHigherReference
open FStar.Ghost
open FStar.PCM
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.GhostPCMReference
open Steel.FractionalPermission
open Steel.Preorder
module Preorder = FStar.Preorder
module Q = Steel.Preorder
module M = Steel.Memory
module PR = Steel.GhostPCMReference
module A = Steel.Effect.Atomic
open FStar.Real
#set-options "--ide_id_info_off"
let ref a p = PR.ref (history a p) pcm_history
[@@__reduce__]
let pts_to_body #a #p (r:ref a p) (f:perm) (v:a) (h:history a p) =
PR.pts_to r h `star`
pure (history_val h v f)
let pts_to' (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v: a) =
h_exists (pts_to_body r f v)
let pts_to_sl r f v = hp_of (pts_to' r f v)
let intro_pure #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to_body r f v h)
= A.intro_pure (history_val h v f)
let intro_pure_full #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to r f v)
= intro_pure #_ #a #p #f r v h;
intro_exists h (pts_to_body r f v)
let alloc #_ (#a:Type) (p:Preorder.preorder a) (v:a)
= let h = Current [v] full_perm in
assert (compatible pcm_history h h);
let x : ref a p = alloc h in
intro_pure_full x v h;
x
let extract_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h)
= elim_pure (history_val h v f);
A.intro_pure (history_val h v f)
let elim_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> PR.pts_to r h)
= let _ = extract_pure r v h in
drop (pure (history_val h v f))
let write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True)
= let h_old_e = witness_exists #_ #_ #(pts_to_body r full_perm v) () in
let _ = elim_pure r v h_old_e in
let h_old = read r in
let h: history a p = extend_history' h_old x in
write r h_old_e h;
intro_pure_full r x h
let witnessed #a #p r fact =
PR.witnessed r (lift_fact fact)
let get_squash (#p:prop) (_:unit{p}) : squash p = ()
let witness_thunk (#inames: _) (#a:Type) (#pcm:FStar.PCM.pcm a)
(r:PR.ref a pcm)
(fact:M.stable_property pcm)
(v:erased a)
(sq:squash (fact_valid_compat #_ #pcm fact v))
(_:unit)
: SteelAtomicUT (PR.witnessed r fact) inames
(PR.pts_to r v)
(fun _ -> PR.pts_to r v)
= witness r fact v sq
let witness (#inames: _) (#a:Type) (#q:perm) (#p:Preorder.preorder a)
(r:ref a p)
(fact:stable_property p)
(v:erased a)
(_:squash (fact v))
: SteelAtomicUT (witnessed r fact) inames
(pts_to r q v)
(fun _ -> pts_to r q v)
= let h = witness_exists #_ #_ #(pts_to_body r q v) () in
let _ = elim_pure #_ #_ #_ #q r v h in
assert (forall h'. compatible pcm_history h h' ==> lift_fact fact h');
lift_fact_is_stable #a #p fact;
let w = witness_thunk #_ #_ #(pcm_history #a #p) r (lift_fact fact) h () () in
intro_pure_full r v h;
rewrite_slprop (pts_to _ q _) (pts_to r q v) (fun _ -> ());
return w
let recall (#inames: _) (#a:Type u#1) (#q:perm) (#p:Preorder.preorder a) (fact:property a) | false | false | Steel.GhostMonotonicHigherReference.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 recall (#inames: _) (#a:Type u#1) (#q:perm) (#p:Preorder.preorder a)
(fact:property a)
(r:ref a p)
(v:erased a)
(w:witnessed r fact)
: SteelAtomicU unit inames
(pts_to r q v)
(fun _ -> pts_to r q v)
(requires fun _ -> True)
(ensures fun _ _ _ -> fact v) | [] | Steel.GhostMonotonicHigherReference.recall | {
"file_name": "lib/steel/Steel.GhostMonotonicHigherReference.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
fact: Steel.GhostMonotonicHigherReference.property a ->
r: Steel.GhostMonotonicHigherReference.ref a p ->
v: FStar.Ghost.erased a ->
w: Steel.GhostMonotonicHigherReference.witnessed r fact
-> Steel.Effect.Atomic.SteelAtomicU Prims.unit | {
"end_col": 62,
"end_line": 157,
"start_col": 3,
"start_line": 151
} |
Steel.Effect.Atomic.SteelGhost | val write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True) | [
{
"abbrev": false,
"full_module": "FStar.Real",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Effect.Atomic",
"short_module": "A"
},
{
"abbrev": true,
"full_module": "Steel.GhostPCMReference",
"short_module": "PR"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Steel.Preorder",
"short_module": "Q"
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.GhostPCMReference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True)
= let h_old_e = witness_exists #_ #_ #(pts_to_body r full_perm v) () in
let _ = elim_pure r v h_old_e in
let h_old = read r in
let h: history a p = extend_history' h_old x in
write r h_old_e h;
intro_pure_full r x h | val write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True)
let write (#opened: _) (#a: Type) (#p: Preorder.preorder a) (#v: a) (r: ref a p) (x: a)
: SteelGhost unit
opened
(pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True) = | true | null | false | let h_old_e = witness_exists #_ #_ #(pts_to_body r full_perm v) () in
let _ = elim_pure r v h_old_e in
let h_old = read r in
let h:history a p = extend_history' h_old x in
write r h_old_e h;
intro_pure_full r x h | {
"checked_file": "Steel.GhostMonotonicHigherReference.fst.checked",
"dependencies": [
"Steel.Preorder.fst.checked",
"Steel.Memory.fsti.checked",
"Steel.GhostPCMReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.GhostMonotonicHigherReference.fst"
} | [] | [
"Steel.Memory.inames",
"FStar.Preorder.preorder",
"Steel.GhostMonotonicHigherReference.ref",
"Steel.GhostMonotonicHigherReference.intro_pure_full",
"Steel.FractionalPermission.full_perm",
"Prims.unit",
"Steel.GhostPCMReference.write",
"Steel.Preorder.history",
"Steel.Preorder.pcm_history",
"FStar.Ghost.reveal",
"Steel.Preorder.extend_history'",
"Steel.GhostPCMReference.read",
"Steel.Preorder.history_val",
"FStar.Ghost.hide",
"Steel.GhostMonotonicHigherReference.elim_pure",
"FStar.Ghost.erased",
"Steel.Effect.Atomic.witness_exists",
"Steel.GhostMonotonicHigherReference.pts_to_body",
"Steel.GhostMonotonicHigherReference.pts_to",
"Steel.Effect.Common.vprop",
"Steel.Effect.Common.rmem",
"Prims.l_and",
"Prims.l_True"
] | [] | (*
Copyright 2020 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 Steel.GhostMonotonicHigherReference
open FStar.Ghost
open FStar.PCM
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.GhostPCMReference
open Steel.FractionalPermission
open Steel.Preorder
module Preorder = FStar.Preorder
module Q = Steel.Preorder
module M = Steel.Memory
module PR = Steel.GhostPCMReference
module A = Steel.Effect.Atomic
open FStar.Real
#set-options "--ide_id_info_off"
let ref a p = PR.ref (history a p) pcm_history
[@@__reduce__]
let pts_to_body #a #p (r:ref a p) (f:perm) (v:a) (h:history a p) =
PR.pts_to r h `star`
pure (history_val h v f)
let pts_to' (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v: a) =
h_exists (pts_to_body r f v)
let pts_to_sl r f v = hp_of (pts_to' r f v)
let intro_pure #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to_body r f v h)
= A.intro_pure (history_val h v f)
let intro_pure_full #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to r f v)
= intro_pure #_ #a #p #f r v h;
intro_exists h (pts_to_body r f v)
let alloc #_ (#a:Type) (p:Preorder.preorder a) (v:a)
= let h = Current [v] full_perm in
assert (compatible pcm_history h h);
let x : ref a p = alloc h in
intro_pure_full x v h;
x
let extract_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h)
= elim_pure (history_val h v f);
A.intro_pure (history_val h v f)
let elim_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> PR.pts_to r h)
= let _ = extract_pure r v h in
drop (pure (history_val h v f))
let write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True) | false | false | Steel.GhostMonotonicHigherReference.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 write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True) | [] | Steel.GhostMonotonicHigherReference.write | {
"file_name": "lib/steel/Steel.GhostMonotonicHigherReference.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | r: Steel.GhostMonotonicHigherReference.ref a p -> x: a -> Steel.Effect.Atomic.SteelGhost Prims.unit | {
"end_col": 25,
"end_line": 110,
"start_col": 3,
"start_line": 103
} |
Steel.Effect.Atomic.SteelAtomicUT | val witness (#inames: _) (#a:Type) (#q:perm) (#p:Preorder.preorder a) (r:ref a p)
(fact:stable_property p)
(v:erased a)
(_:squash (fact v))
: SteelAtomicUT (witnessed r fact) inames
(pts_to r q v)
(fun _ -> pts_to r q v) | [
{
"abbrev": false,
"full_module": "FStar.Real",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Effect.Atomic",
"short_module": "A"
},
{
"abbrev": true,
"full_module": "Steel.GhostPCMReference",
"short_module": "PR"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Steel.Preorder",
"short_module": "Q"
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.GhostPCMReference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let witness (#inames: _) (#a:Type) (#q:perm) (#p:Preorder.preorder a)
(r:ref a p)
(fact:stable_property p)
(v:erased a)
(_:squash (fact v))
: SteelAtomicUT (witnessed r fact) inames
(pts_to r q v)
(fun _ -> pts_to r q v)
= let h = witness_exists #_ #_ #(pts_to_body r q v) () in
let _ = elim_pure #_ #_ #_ #q r v h in
assert (forall h'. compatible pcm_history h h' ==> lift_fact fact h');
lift_fact_is_stable #a #p fact;
let w = witness_thunk #_ #_ #(pcm_history #a #p) r (lift_fact fact) h () () in
intro_pure_full r v h;
rewrite_slprop (pts_to _ q _) (pts_to r q v) (fun _ -> ());
return w | val witness (#inames: _) (#a:Type) (#q:perm) (#p:Preorder.preorder a) (r:ref a p)
(fact:stable_property p)
(v:erased a)
(_:squash (fact v))
: SteelAtomicUT (witnessed r fact) inames
(pts_to r q v)
(fun _ -> pts_to r q v)
let witness
(#inames: _)
(#a: Type)
(#q: perm)
(#p: Preorder.preorder a)
(r: ref a p)
(fact: stable_property p)
(v: erased a)
(_: squash (fact v))
: SteelAtomicUT (witnessed r fact) inames (pts_to r q v) (fun _ -> pts_to r q v) = | true | null | false | let h = witness_exists #_ #_ #(pts_to_body r q v) () in
let _ = elim_pure #_ #_ #_ #q r v h in
assert (forall h'. compatible pcm_history h h' ==> lift_fact fact h');
lift_fact_is_stable #a #p fact;
let w = witness_thunk #_ #_ #(pcm_history #a #p) r (lift_fact fact) h () () in
intro_pure_full r v h;
rewrite_slprop (pts_to _ q _) (pts_to r q v) (fun _ -> ());
return w | {
"checked_file": "Steel.GhostMonotonicHigherReference.fst.checked",
"dependencies": [
"Steel.Preorder.fst.checked",
"Steel.Memory.fsti.checked",
"Steel.GhostPCMReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.GhostMonotonicHigherReference.fst"
} | [] | [
"Steel.Memory.inames",
"Steel.FractionalPermission.perm",
"FStar.Preorder.preorder",
"Steel.GhostMonotonicHigherReference.ref",
"Steel.GhostMonotonicHigherReference.stable_property",
"FStar.Ghost.erased",
"Prims.squash",
"FStar.Ghost.reveal",
"Steel.Effect.Atomic.return",
"Steel.GhostMonotonicHigherReference.witnessed",
"Steel.GhostMonotonicHigherReference.pts_to",
"Steel.Effect.Common.vprop",
"Prims.unit",
"Steel.Effect.Atomic.rewrite_slprop",
"Steel.Memory.mem",
"Steel.GhostMonotonicHigherReference.intro_pure_full",
"Steel.Preorder.history",
"Steel.GhostPCMReference.witnessed",
"Steel.Preorder.pcm_history",
"Steel.Preorder.lift_fact",
"Steel.GhostMonotonicHigherReference.witness_thunk",
"Steel.Preorder.lift_fact_is_stable",
"Prims._assert",
"Prims.l_Forall",
"Prims.l_imp",
"FStar.PCM.compatible",
"Steel.Preorder.history_val",
"FStar.Ghost.hide",
"Steel.GhostMonotonicHigherReference.elim_pure",
"Steel.Effect.Atomic.witness_exists",
"Steel.GhostMonotonicHigherReference.pts_to_body"
] | [] | (*
Copyright 2020 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 Steel.GhostMonotonicHigherReference
open FStar.Ghost
open FStar.PCM
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.GhostPCMReference
open Steel.FractionalPermission
open Steel.Preorder
module Preorder = FStar.Preorder
module Q = Steel.Preorder
module M = Steel.Memory
module PR = Steel.GhostPCMReference
module A = Steel.Effect.Atomic
open FStar.Real
#set-options "--ide_id_info_off"
let ref a p = PR.ref (history a p) pcm_history
[@@__reduce__]
let pts_to_body #a #p (r:ref a p) (f:perm) (v:a) (h:history a p) =
PR.pts_to r h `star`
pure (history_val h v f)
let pts_to' (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v: a) =
h_exists (pts_to_body r f v)
let pts_to_sl r f v = hp_of (pts_to' r f v)
let intro_pure #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to_body r f v h)
= A.intro_pure (history_val h v f)
let intro_pure_full #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to r f v)
= intro_pure #_ #a #p #f r v h;
intro_exists h (pts_to_body r f v)
let alloc #_ (#a:Type) (p:Preorder.preorder a) (v:a)
= let h = Current [v] full_perm in
assert (compatible pcm_history h h);
let x : ref a p = alloc h in
intro_pure_full x v h;
x
let extract_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h)
= elim_pure (history_val h v f);
A.intro_pure (history_val h v f)
let elim_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> PR.pts_to r h)
= let _ = extract_pure r v h in
drop (pure (history_val h v f))
let write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True)
= let h_old_e = witness_exists #_ #_ #(pts_to_body r full_perm v) () in
let _ = elim_pure r v h_old_e in
let h_old = read r in
let h: history a p = extend_history' h_old x in
write r h_old_e h;
intro_pure_full r x h
let witnessed #a #p r fact =
PR.witnessed r (lift_fact fact)
let get_squash (#p:prop) (_:unit{p}) : squash p = ()
let witness_thunk (#inames: _) (#a:Type) (#pcm:FStar.PCM.pcm a)
(r:PR.ref a pcm)
(fact:M.stable_property pcm)
(v:erased a)
(sq:squash (fact_valid_compat #_ #pcm fact v))
(_:unit)
: SteelAtomicUT (PR.witnessed r fact) inames
(PR.pts_to r v)
(fun _ -> PR.pts_to r v)
= witness r fact v sq
let witness (#inames: _) (#a:Type) (#q:perm) (#p:Preorder.preorder a)
(r:ref a p)
(fact:stable_property p)
(v:erased a)
(_:squash (fact v))
: SteelAtomicUT (witnessed r fact) inames
(pts_to r q v) | false | false | Steel.GhostMonotonicHigherReference.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 witness (#inames: _) (#a:Type) (#q:perm) (#p:Preorder.preorder a) (r:ref a p)
(fact:stable_property p)
(v:erased a)
(_:squash (fact v))
: SteelAtomicUT (witnessed r fact) inames
(pts_to r q v)
(fun _ -> pts_to r q v) | [] | Steel.GhostMonotonicHigherReference.witness | {
"file_name": "lib/steel/Steel.GhostMonotonicHigherReference.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
r: Steel.GhostMonotonicHigherReference.ref a p ->
fact: Steel.GhostMonotonicHigherReference.stable_property p ->
v: FStar.Ghost.erased a ->
_: Prims.squash (fact (FStar.Ghost.reveal v))
-> Steel.Effect.Atomic.SteelAtomicUT (Steel.GhostMonotonicHigherReference.witnessed r fact) | {
"end_col": 12,
"end_line": 147,
"start_col": 3,
"start_line": 136
} |
Steel.Effect.Atomic.SteelGhostT | val share (#inames:_)
(#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a)
: SteelGhostT unit inames
(pts_to r f v)
(fun _ -> pts_to r (half_perm f) v `star` pts_to r (half_perm f) v) | [
{
"abbrev": false,
"full_module": "FStar.Real",
"short_module": null
},
{
"abbrev": true,
"full_module": "Steel.Effect.Atomic",
"short_module": "A"
},
{
"abbrev": true,
"full_module": "Steel.GhostPCMReference",
"short_module": "PR"
},
{
"abbrev": true,
"full_module": "Steel.Memory",
"short_module": "M"
},
{
"abbrev": true,
"full_module": "Steel.Preorder",
"short_module": "Q"
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Preorder",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.GhostPCMReference",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": true,
"full_module": "FStar.Preorder",
"short_module": "Preorder"
},
{
"abbrev": false,
"full_module": "Steel.Effect",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Effect.Atomic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.Memory",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.FractionalPermission",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Ghost",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.PCM",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let share #o (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v:a)
: SteelGhostT unit o
(pts_to r f v)
(fun _ -> pts_to r (half_perm f) v `star` pts_to r (half_perm f) v)
= let open Steel.Effect.Atomic in
elim_pts_to r f v;
let h : erased (history a p) = witness_exists () in
elim_pure _;
let sh = split_current h in
PR.share r h sh sh;
intro_pure (history_val sh v (half_perm f));
intro_exists #(history a p) sh (pts_to_body r (half_perm f) v);
intro_pts_to r (half_perm f) v;
intro_pure (history_val sh v (half_perm f));
intro_exists #(history a p) sh (pts_to_body r (half_perm f) v);
intro_pts_to r (half_perm f) v | val share (#inames:_)
(#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a)
: SteelGhostT unit inames
(pts_to r f v)
(fun _ -> pts_to r (half_perm f) v `star` pts_to r (half_perm f) v)
let share #o (#a: Type) (#p: Preorder.preorder a) (r: ref a p) (f: perm) (v: a)
: SteelGhostT unit
o
(pts_to r f v)
(fun _ -> (pts_to r (half_perm f) v) `star` (pts_to r (half_perm f) v)) = | true | null | false | let open Steel.Effect.Atomic in
elim_pts_to r f v;
let h:erased (history a p) = witness_exists () in
elim_pure _;
let sh = split_current h in
PR.share r h sh sh;
intro_pure (history_val sh v (half_perm f));
intro_exists #(history a p) sh (pts_to_body r (half_perm f) v);
intro_pts_to r (half_perm f) v;
intro_pure (history_val sh v (half_perm f));
intro_exists #(history a p) sh (pts_to_body r (half_perm f) v);
intro_pts_to r (half_perm f) v | {
"checked_file": "Steel.GhostMonotonicHigherReference.fst.checked",
"dependencies": [
"Steel.Preorder.fst.checked",
"Steel.Memory.fsti.checked",
"Steel.GhostPCMReference.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"Steel.Effect.Atomic.fsti.checked",
"Steel.Effect.fsti.checked",
"prims.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Preorder.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.PCM.fst.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": true,
"source_file": "Steel.GhostMonotonicHigherReference.fst"
} | [] | [
"Steel.Memory.inames",
"FStar.Preorder.preorder",
"Steel.GhostMonotonicHigherReference.ref",
"Steel.FractionalPermission.perm",
"Steel.GhostMonotonicHigherReference.intro_pts_to",
"Steel.FractionalPermission.half_perm",
"Prims.unit",
"Steel.Effect.Atomic.intro_exists",
"Steel.Preorder.history",
"Steel.GhostMonotonicHigherReference.pts_to_body",
"Steel.Effect.Atomic.intro_pure",
"Steel.Preorder.history_val",
"FStar.Ghost.hide",
"Steel.GhostPCMReference.share",
"Steel.Preorder.pcm_history",
"FStar.Ghost.reveal",
"Prims.l_and",
"Prims.b2t",
"Steel.Preorder.uu___is_Current",
"FStar.PCM.composable",
"Prims.eq2",
"FStar.PCM.op",
"Steel.Preorder.vhist",
"Steel.Preorder.__proj__Current__item__h",
"Steel.Preorder.hval",
"Steel.Preorder.__proj__Current__item__f",
"Steel.Preorder.split_current",
"Steel.Effect.Atomic.elim_pure",
"FStar.Ghost.erased",
"Steel.Effect.Atomic.witness_exists",
"Steel.GhostMonotonicHigherReference.elim_pts_to",
"Steel.GhostMonotonicHigherReference.pts_to",
"Steel.Effect.Common.star",
"Steel.Effect.Common.vprop"
] | [] | (*
Copyright 2020 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 Steel.GhostMonotonicHigherReference
open FStar.Ghost
open FStar.PCM
open Steel.Memory
open Steel.Effect.Atomic
open Steel.Effect
open Steel.GhostPCMReference
open Steel.FractionalPermission
open Steel.Preorder
module Preorder = FStar.Preorder
module Q = Steel.Preorder
module M = Steel.Memory
module PR = Steel.GhostPCMReference
module A = Steel.Effect.Atomic
open FStar.Real
#set-options "--ide_id_info_off"
let ref a p = PR.ref (history a p) pcm_history
[@@__reduce__]
let pts_to_body #a #p (r:ref a p) (f:perm) (v:a) (h:history a p) =
PR.pts_to r h `star`
pure (history_val h v f)
let pts_to' (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v: a) =
h_exists (pts_to_body r f v)
let pts_to_sl r f v = hp_of (pts_to' r f v)
let intro_pure #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to_body r f v h)
= A.intro_pure (history_val h v f)
let intro_pure_full #opened #a #p #f
(r:ref a p)
(v:a)
(h:history a p { history_val h v f })
: SteelGhostT unit opened
(PR.pts_to r h)
(fun _ -> pts_to r f v)
= intro_pure #_ #a #p #f r v h;
intro_exists h (pts_to_body r f v)
let alloc #_ (#a:Type) (p:Preorder.preorder a) (v:a)
= let h = Current [v] full_perm in
assert (compatible pcm_history h h);
let x : ref a p = alloc h in
intro_pure_full x v h;
x
let extract_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> pts_to_body r f v h)
= elim_pure (history_val h v f);
A.intro_pure (history_val h v f)
let elim_pure #a #uses #p #f
(r:ref a p)
(v:a)
(h:(history a p))
: SteelGhostT (_:unit{history_val h v f})
uses
(pts_to_body r f v h)
(fun _ -> PR.pts_to r h)
= let _ = extract_pure r v h in
drop (pure (history_val h v f))
let write (#opened: _) (#a:Type) (#p:Preorder.preorder a) (#v:a)
(r:ref a p) (x:a)
: SteelGhost unit opened (pts_to r full_perm v)
(fun v -> pts_to r full_perm x)
(requires fun _ -> p v x /\ True)
(ensures fun _ _ _ -> True)
= let h_old_e = witness_exists #_ #_ #(pts_to_body r full_perm v) () in
let _ = elim_pure r v h_old_e in
let h_old = read r in
let h: history a p = extend_history' h_old x in
write r h_old_e h;
intro_pure_full r x h
let witnessed #a #p r fact =
PR.witnessed r (lift_fact fact)
let get_squash (#p:prop) (_:unit{p}) : squash p = ()
let witness_thunk (#inames: _) (#a:Type) (#pcm:FStar.PCM.pcm a)
(r:PR.ref a pcm)
(fact:M.stable_property pcm)
(v:erased a)
(sq:squash (fact_valid_compat #_ #pcm fact v))
(_:unit)
: SteelAtomicUT (PR.witnessed r fact) inames
(PR.pts_to r v)
(fun _ -> PR.pts_to r v)
= witness r fact v sq
let witness (#inames: _) (#a:Type) (#q:perm) (#p:Preorder.preorder a)
(r:ref a p)
(fact:stable_property p)
(v:erased a)
(_:squash (fact v))
: SteelAtomicUT (witnessed r fact) inames
(pts_to r q v)
(fun _ -> pts_to r q v)
= let h = witness_exists #_ #_ #(pts_to_body r q v) () in
let _ = elim_pure #_ #_ #_ #q r v h in
assert (forall h'. compatible pcm_history h h' ==> lift_fact fact h');
lift_fact_is_stable #a #p fact;
let w = witness_thunk #_ #_ #(pcm_history #a #p) r (lift_fact fact) h () () in
intro_pure_full r v h;
rewrite_slprop (pts_to _ q _) (pts_to r q v) (fun _ -> ());
return w
let recall (#inames: _) (#a:Type u#1) (#q:perm) (#p:Preorder.preorder a) (fact:property a)
(r:ref a p) (v:erased a) (w:witnessed r fact)
= let h = witness_exists #_ #_ #(pts_to_body r q v) () in
let _ = elim_pure #_ #_ #_ #q r v h in
let h1 = recall (lift_fact fact) r h w in
intro_pure_full r v h;
rewrite_slprop (pts_to _ q _) (pts_to r q v) (fun _ -> ())
let elim_pts_to #o (#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a)
: SteelGhostT unit o
(pts_to r f v)
(fun _ -> pts_to' r f v)
= rewrite_slprop _ _ (fun _ -> ())
let intro_pts_to #o (#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a)
: SteelGhostT unit o
(pts_to' r f v)
(fun _ -> pts_to' r f v)
= rewrite_slprop _ _ (fun _ -> ())
let share #o (#a:Type) (#p:Preorder.preorder a) (r:ref a p) (f:perm) (v:a)
: SteelGhostT unit o
(pts_to r f v) | false | false | Steel.GhostMonotonicHigherReference.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 share (#inames:_)
(#a:Type)
(#p:Preorder.preorder a)
(r:ref a p)
(f:perm)
(v:a)
: SteelGhostT unit inames
(pts_to r f v)
(fun _ -> pts_to r (half_perm f) v `star` pts_to r (half_perm f) v) | [] | Steel.GhostMonotonicHigherReference.share | {
"file_name": "lib/steel/Steel.GhostMonotonicHigherReference.fst",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | r: Steel.GhostMonotonicHigherReference.ref a p -> f: Steel.FractionalPermission.perm -> v: a
-> Steel.Effect.Atomic.SteelGhostT Prims.unit | {
"end_col": 34,
"end_line": 195,
"start_col": 4,
"start_line": 184
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let pfelem = Scalar.felem | let pfelem = | false | null | false | Scalar.felem | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Spec.Poly1305.felem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime) | false | true | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val pfelem : Type0 | [] | Hacl.Spec.Poly1305.Vec.pfelem | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 25,
"end_line": 25,
"start_col": 13,
"start_line": 25
} |
|
Prims.Tot | val pfmul (x y: pfelem) : pfelem | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y | val pfmul (x y: pfelem) : pfelem
let pfmul (x y: pfelem) : pfelem = | false | null | false | Scalar.fmul x y | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.pfelem",
"Spec.Poly1305.fmul"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem | false | true | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val pfmul (x y: pfelem) : pfelem | [] | Hacl.Spec.Poly1305.Vec.pfmul | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Hacl.Spec.Poly1305.Vec.pfelem -> y: Hacl.Spec.Poly1305.Vec.pfelem
-> Hacl.Spec.Poly1305.Vec.pfelem | {
"end_col": 58,
"end_line": 27,
"start_col": 43,
"start_line": 27
} |
Prims.Tot | val size_block:size_nat | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let size_block : size_nat = Scalar.size_block | val size_block:size_nat
let size_block:size_nat = | false | null | false | Scalar.size_block | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Spec.Poly1305.size_block"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val size_block:size_nat | [] | Hacl.Spec.Poly1305.Vec.size_block | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | n: Prims.nat{n <= Prims.pow2 32 - 1} | {
"end_col": 45,
"end_line": 43,
"start_col": 28,
"start_line": 43
} |
Prims.Tot | val fadd (#w: lanes) (x y: elem w) : elem w | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y | val fadd (#w: lanes) (x y: elem w) : elem w
let fadd (#w: lanes) (x y: elem w) : elem w = | false | null | false | map2 pfadd x y | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Hacl.Spec.Poly1305.Vec.elem",
"Lib.Sequence.map2",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.pfadd"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0 | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val fadd (#w: lanes) (x y: elem w) : elem w | [] | Hacl.Spec.Poly1305.Vec.fadd | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Hacl.Spec.Poly1305.Vec.elem w -> y: Hacl.Spec.Poly1305.Vec.elem w
-> Hacl.Spec.Poly1305.Vec.elem w | {
"end_col": 16,
"end_line": 38,
"start_col": 2,
"start_line": 38
} |
Prims.Tot | val to_elem (w: lanes) (x: pfelem) : elem w | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let to_elem (w:lanes) (x:pfelem) : elem w = create w x | val to_elem (w: lanes) (x: pfelem) : elem w
let to_elem (w: lanes) (x: pfelem) : elem w = | false | null | false | create w x | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Lib.Sequence.create",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val to_elem (w: lanes) (x: pfelem) : elem w | [] | Hacl.Spec.Poly1305.Vec.to_elem | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | w: Hacl.Spec.Poly1305.Vec.lanes -> x: Hacl.Spec.Poly1305.Vec.pfelem -> Hacl.Spec.Poly1305.Vec.elem w | {
"end_col": 54,
"end_line": 33,
"start_col": 44,
"start_line": 33
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let lanes = w:width{w == 1 \/ w == 2 \/ w == 4} | let lanes = | false | null | false | w: width{w == 1 \/ w == 2 \/ w == 4} | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Lib.IntVector.width",
"Prims.l_or",
"Prims.eq2",
"Prims.int"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y | false | true | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lanes : Type0 | [] | Hacl.Spec.Poly1305.Vec.lanes | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Type0 | {
"end_col": 47,
"end_line": 29,
"start_col": 12,
"start_line": 29
} |
|
Prims.Tot | val pfadd (x y: pfelem) : pfelem | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y | val pfadd (x y: pfelem) : pfelem
let pfadd (x y: pfelem) : pfelem = | false | null | false | Scalar.fadd x y | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.pfelem",
"Spec.Poly1305.fadd"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime | false | true | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val pfadd (x y: pfelem) : pfelem | [] | Hacl.Spec.Poly1305.Vec.pfadd | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Hacl.Spec.Poly1305.Vec.pfelem -> y: Hacl.Spec.Poly1305.Vec.pfelem
-> Hacl.Spec.Poly1305.Vec.pfelem | {
"end_col": 58,
"end_line": 26,
"start_col": 43,
"start_line": 26
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let prime = Scalar.prime | let prime = | false | null | false | Scalar.prime | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Spec.Poly1305.prime"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime) | false | true | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val prime : Prims.pos | [] | Hacl.Spec.Poly1305.Vec.prime | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | Prims.pos | {
"end_col": 24,
"end_line": 24,
"start_col": 12,
"start_line": 24
} |
|
Prims.Tot | val poly1305_mac (#w: lanes) (msg: bytes) (k: Scalar.key) : Scalar.tag | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let poly1305_mac (#w:lanes) (msg:bytes) (k:Scalar.key) : Scalar.tag =
let acc, r = Scalar.poly1305_init k in
let acc = poly1305_update #w msg acc r in
Scalar.poly1305_finish k acc | val poly1305_mac (#w: lanes) (msg: bytes) (k: Scalar.key) : Scalar.tag
let poly1305_mac (#w: lanes) (msg: bytes) (k: Scalar.key) : Scalar.tag = | false | null | false | let acc, r = Scalar.poly1305_init k in
let acc = poly1305_update #w msg acc r in
Scalar.poly1305_finish k acc | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Lib.ByteSequence.bytes",
"Spec.Poly1305.key",
"Spec.Poly1305.felem",
"Spec.Poly1305.poly1305_finish",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.poly1305_update",
"Spec.Poly1305.tag",
"FStar.Pervasives.Native.tuple2",
"Spec.Poly1305.poly1305_init"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text)
let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc
let normalize_1 (r:pfelem) (acc:elem 1) : pfelem =
pfmul acc.[0] r
let normalize_2 (r:pfelem) (acc:elem 2) : pfelem =
let r2 = pfmul r r in
let r21 = create2 r2 r in
let a = fmul acc r21 in
pfadd a.[0] a.[1]
let normalize_4 (r:pfelem) (acc:elem 4) : pfelem =
let r2 = pfmul r r in
let r3 = pfmul r2 r in
let r4 = pfmul r2 r2 in
let r4321 = create4 r4 r3 r2 r in
let a = fmul acc r4321 in
pfadd (pfadd (pfadd a.[0] a.[1]) a.[2]) a.[3]
let normalize_n (#w:lanes) (r:pfelem) (acc:elem w) : pfelem =
match w with
| 1 -> normalize_1 r acc
| 2 -> normalize_2 r acc
| 4 -> normalize_4 r acc
let compute_r1 (r:pfelem) : elem 1 = to_elem 1 r
let compute_r2 (r:pfelem) : elem 2 = to_elem 2 (pfmul r r)
let compute_r4 (r:pfelem) : elem 4 = to_elem 4 (pfmul (pfmul r r) (pfmul r r))
let compute_rw (#w:lanes) (r:pfelem) : elem w =
match w with
| 1 -> compute_r1 r
| 2 -> compute_r2 r
| 4 -> compute_r4 r
let poly1305_update_nblocks (#w:lanes) (r_w:elem w) (b:lbytes (w * size_block)) (acc:elem w) : elem w =
let e = load_blocks b in
let acc = fadd (fmul acc r_w) e in
acc
let poly1305_update_multi (#w:lanes) (text:bytes{0 < length text /\ length text % (w * size_block) = 0}) (acc:pfelem) (r:pfelem) : pfelem =
let rw = compute_rw r in
let acc = load_acc (Seq.slice text 0 (w * size_block)) acc in
let text = Seq.slice text (w * size_block) (length text) in
let acc = repeat_blocks_multi #uint8 #(elem w) (w * size_block) text (poly1305_update_nblocks rw) acc in
let acc = normalize_n r acc in
acc
let poly1305_update_vec (#w:lanes) (text:bytes) (acc:pfelem) (r:pfelem) : pfelem =
let len = length text in
let sz_block = w * size_block in
let len0 = len / sz_block * sz_block in
let t0 = Seq.slice text 0 len0 in
let acc = if len0 > 0 then poly1305_update_multi #w t0 acc r else acc in
let t1 = Seq.slice text len0 len in
Scalar.poly1305_update t1 acc r
let poly1305_update (#w:lanes) (text:bytes) (acc:pfelem) (r:pfelem) : pfelem =
match w with
| 1 -> Scalar.poly1305_update text acc r
| 2 -> poly1305_update_vec #2 text acc r
| 4 -> poly1305_update_vec #4 text acc r | false | true | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val poly1305_mac (#w: lanes) (msg: bytes) (k: Scalar.key) : Scalar.tag | [] | Hacl.Spec.Poly1305.Vec.poly1305_mac | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | msg: Lib.ByteSequence.bytes -> k: Spec.Poly1305.key -> Spec.Poly1305.tag | {
"end_col": 30,
"end_line": 158,
"start_col": 69,
"start_line": 155
} |
Prims.Tot | val fmul (#w: lanes) (x y: elem w) : elem w | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y | val fmul (#w: lanes) (x y: elem w) : elem w
let fmul (#w: lanes) (x y: elem w) : elem w = | false | null | false | map2 pfmul x y | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Hacl.Spec.Poly1305.Vec.elem",
"Lib.Sequence.map2",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.pfmul"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val fmul (#w: lanes) (x y: elem w) : elem w | [] | Hacl.Spec.Poly1305.Vec.fmul | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Hacl.Spec.Poly1305.Vec.elem w -> y: Hacl.Spec.Poly1305.Vec.elem w
-> Hacl.Spec.Poly1305.Vec.elem w | {
"end_col": 16,
"end_line": 40,
"start_col": 2,
"start_line": 40
} |
Prims.Tot | val from_elem (#w: lanes) (x: elem w) : pfelem | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0] | val from_elem (#w: lanes) (x: elem w) : pfelem
let from_elem (#w: lanes) (x: elem w) : pfelem = | false | null | false | x.[ 0 ] | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Hacl.Spec.Poly1305.Vec.elem",
"Lib.Sequence.op_String_Access",
"Hacl.Spec.Poly1305.Vec.pfelem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val from_elem (#w: lanes) (x: elem w) : pfelem | [] | Hacl.Spec.Poly1305.Vec.from_elem | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | x: Hacl.Spec.Poly1305.Vec.elem w -> Hacl.Spec.Poly1305.Vec.pfelem | {
"end_col": 52,
"end_line": 34,
"start_col": 47,
"start_line": 34
} |
Prims.Tot | val compute_rw (#w: lanes) (r: pfelem) : elem w | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let compute_rw (#w:lanes) (r:pfelem) : elem w =
match w with
| 1 -> compute_r1 r
| 2 -> compute_r2 r
| 4 -> compute_r4 r | val compute_rw (#w: lanes) (r: pfelem) : elem w
let compute_rw (#w: lanes) (r: pfelem) : elem w = | false | null | false | match w with
| 1 -> compute_r1 r
| 2 -> compute_r2 r
| 4 -> compute_r4 r | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.compute_r1",
"Hacl.Spec.Poly1305.Vec.compute_r2",
"Hacl.Spec.Poly1305.Vec.compute_r4",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text)
let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc
let normalize_1 (r:pfelem) (acc:elem 1) : pfelem =
pfmul acc.[0] r
let normalize_2 (r:pfelem) (acc:elem 2) : pfelem =
let r2 = pfmul r r in
let r21 = create2 r2 r in
let a = fmul acc r21 in
pfadd a.[0] a.[1]
let normalize_4 (r:pfelem) (acc:elem 4) : pfelem =
let r2 = pfmul r r in
let r3 = pfmul r2 r in
let r4 = pfmul r2 r2 in
let r4321 = create4 r4 r3 r2 r in
let a = fmul acc r4321 in
pfadd (pfadd (pfadd a.[0] a.[1]) a.[2]) a.[3]
let normalize_n (#w:lanes) (r:pfelem) (acc:elem w) : pfelem =
match w with
| 1 -> normalize_1 r acc
| 2 -> normalize_2 r acc
| 4 -> normalize_4 r acc
let compute_r1 (r:pfelem) : elem 1 = to_elem 1 r
let compute_r2 (r:pfelem) : elem 2 = to_elem 2 (pfmul r r)
let compute_r4 (r:pfelem) : elem 4 = to_elem 4 (pfmul (pfmul r r) (pfmul r r)) | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compute_rw (#w: lanes) (r: pfelem) : elem w | [] | Hacl.Spec.Poly1305.Vec.compute_rw | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | r: Hacl.Spec.Poly1305.Vec.pfelem -> Hacl.Spec.Poly1305.Vec.elem w | {
"end_col": 21,
"end_line": 119,
"start_col": 2,
"start_line": 116
} |
Prims.Tot | val poly1305_update (#w: lanes) (text: bytes) (acc r: pfelem) : pfelem | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let poly1305_update (#w:lanes) (text:bytes) (acc:pfelem) (r:pfelem) : pfelem =
match w with
| 1 -> Scalar.poly1305_update text acc r
| 2 -> poly1305_update_vec #2 text acc r
| 4 -> poly1305_update_vec #4 text acc r | val poly1305_update (#w: lanes) (text: bytes) (acc r: pfelem) : pfelem
let poly1305_update (#w: lanes) (text: bytes) (acc r: pfelem) : pfelem = | false | null | false | match w with
| 1 -> Scalar.poly1305_update text acc r
| 2 -> poly1305_update_vec #2 text acc r
| 4 -> poly1305_update_vec #4 text acc r | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Lib.ByteSequence.bytes",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Spec.Poly1305.poly1305_update",
"Hacl.Spec.Poly1305.Vec.poly1305_update_vec"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text)
let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc
let normalize_1 (r:pfelem) (acc:elem 1) : pfelem =
pfmul acc.[0] r
let normalize_2 (r:pfelem) (acc:elem 2) : pfelem =
let r2 = pfmul r r in
let r21 = create2 r2 r in
let a = fmul acc r21 in
pfadd a.[0] a.[1]
let normalize_4 (r:pfelem) (acc:elem 4) : pfelem =
let r2 = pfmul r r in
let r3 = pfmul r2 r in
let r4 = pfmul r2 r2 in
let r4321 = create4 r4 r3 r2 r in
let a = fmul acc r4321 in
pfadd (pfadd (pfadd a.[0] a.[1]) a.[2]) a.[3]
let normalize_n (#w:lanes) (r:pfelem) (acc:elem w) : pfelem =
match w with
| 1 -> normalize_1 r acc
| 2 -> normalize_2 r acc
| 4 -> normalize_4 r acc
let compute_r1 (r:pfelem) : elem 1 = to_elem 1 r
let compute_r2 (r:pfelem) : elem 2 = to_elem 2 (pfmul r r)
let compute_r4 (r:pfelem) : elem 4 = to_elem 4 (pfmul (pfmul r r) (pfmul r r))
let compute_rw (#w:lanes) (r:pfelem) : elem w =
match w with
| 1 -> compute_r1 r
| 2 -> compute_r2 r
| 4 -> compute_r4 r
let poly1305_update_nblocks (#w:lanes) (r_w:elem w) (b:lbytes (w * size_block)) (acc:elem w) : elem w =
let e = load_blocks b in
let acc = fadd (fmul acc r_w) e in
acc
let poly1305_update_multi (#w:lanes) (text:bytes{0 < length text /\ length text % (w * size_block) = 0}) (acc:pfelem) (r:pfelem) : pfelem =
let rw = compute_rw r in
let acc = load_acc (Seq.slice text 0 (w * size_block)) acc in
let text = Seq.slice text (w * size_block) (length text) in
let acc = repeat_blocks_multi #uint8 #(elem w) (w * size_block) text (poly1305_update_nblocks rw) acc in
let acc = normalize_n r acc in
acc
let poly1305_update_vec (#w:lanes) (text:bytes) (acc:pfelem) (r:pfelem) : pfelem =
let len = length text in
let sz_block = w * size_block in
let len0 = len / sz_block * sz_block in
let t0 = Seq.slice text 0 len0 in
let acc = if len0 > 0 then poly1305_update_multi #w t0 acc r else acc in
let t1 = Seq.slice text len0 len in
Scalar.poly1305_update t1 acc r | false | true | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val poly1305_update (#w: lanes) (text: bytes) (acc r: pfelem) : pfelem | [] | Hacl.Spec.Poly1305.Vec.poly1305_update | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
text: Lib.ByteSequence.bytes ->
acc: Hacl.Spec.Poly1305.Vec.pfelem ->
r: Hacl.Spec.Poly1305.Vec.pfelem
-> Hacl.Spec.Poly1305.Vec.pfelem | {
"end_col": 42,
"end_line": 152,
"start_col": 2,
"start_line": 149
} |
Prims.Tot | val zero (w: lanes) : elem w | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let zero (w:lanes) : elem w = to_elem w 0 | val zero (w: lanes) : elem w
let zero (w: lanes) : elem w = | false | null | false | to_elem w 0 | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Hacl.Spec.Poly1305.Vec.to_elem",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val zero (w: lanes) : elem w | [] | Hacl.Spec.Poly1305.Vec.zero | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | w: Hacl.Spec.Poly1305.Vec.lanes -> Hacl.Spec.Poly1305.Vec.elem w | {
"end_col": 41,
"end_line": 35,
"start_col": 30,
"start_line": 35
} |
Prims.Tot | val normalize_n (#w: lanes) (r: pfelem) (acc: elem w) : pfelem | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let normalize_n (#w:lanes) (r:pfelem) (acc:elem w) : pfelem =
match w with
| 1 -> normalize_1 r acc
| 2 -> normalize_2 r acc
| 4 -> normalize_4 r acc | val normalize_n (#w: lanes) (r: pfelem) (acc: elem w) : pfelem
let normalize_n (#w: lanes) (r: pfelem) (acc: elem w) : pfelem = | false | null | false | match w with
| 1 -> normalize_1 r acc
| 2 -> normalize_2 r acc
| 4 -> normalize_4 r acc | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.elem",
"Hacl.Spec.Poly1305.Vec.normalize_1",
"Hacl.Spec.Poly1305.Vec.normalize_2",
"Hacl.Spec.Poly1305.Vec.normalize_4"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text)
let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc
let normalize_1 (r:pfelem) (acc:elem 1) : pfelem =
pfmul acc.[0] r
let normalize_2 (r:pfelem) (acc:elem 2) : pfelem =
let r2 = pfmul r r in
let r21 = create2 r2 r in
let a = fmul acc r21 in
pfadd a.[0] a.[1]
let normalize_4 (r:pfelem) (acc:elem 4) : pfelem =
let r2 = pfmul r r in
let r3 = pfmul r2 r in
let r4 = pfmul r2 r2 in
let r4321 = create4 r4 r3 r2 r in
let a = fmul acc r4321 in
pfadd (pfadd (pfadd a.[0] a.[1]) a.[2]) a.[3] | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val normalize_n (#w: lanes) (r: pfelem) (acc: elem w) : pfelem | [] | Hacl.Spec.Poly1305.Vec.normalize_n | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | r: Hacl.Spec.Poly1305.Vec.pfelem -> acc: Hacl.Spec.Poly1305.Vec.elem w
-> Hacl.Spec.Poly1305.Vec.pfelem | {
"end_col": 26,
"end_line": 110,
"start_col": 2,
"start_line": 107
} |
FStar.Pervasives.Lemma | val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)] | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_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_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime) | val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n = | false | null | true | Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime) | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"lemma"
] | [
"Prims.nat",
"FStar.Pervasives.assert_norm",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.pow2",
"Spec.Poly1305.prime",
"Prims.unit",
"Prims._assert",
"Prims.op_LessThanOrEqual",
"FStar.Math.Lemmas.pow2_le_compat"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)] | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)] | [] | Hacl.Spec.Poly1305.Vec.lemma_pow2_128 | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | n: Prims.nat
-> FStar.Pervasives.Lemma (requires n <= 128)
(ensures Prims.pow2 n < Spec.Poly1305.prime)
[SMTPat (Prims.pow2 n)] | {
"end_col": 39,
"end_line": 22,
"start_col": 2,
"start_line": 20
} |
Prims.Tot | val compute_r4 (r: pfelem) : elem 4 | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let compute_r4 (r:pfelem) : elem 4 = to_elem 4 (pfmul (pfmul r r) (pfmul r r)) | val compute_r4 (r: pfelem) : elem 4
let compute_r4 (r: pfelem) : elem 4 = | false | null | false | to_elem 4 (pfmul (pfmul r r) (pfmul r r)) | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.to_elem",
"Hacl.Spec.Poly1305.Vec.pfmul",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text)
let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc
let normalize_1 (r:pfelem) (acc:elem 1) : pfelem =
pfmul acc.[0] r
let normalize_2 (r:pfelem) (acc:elem 2) : pfelem =
let r2 = pfmul r r in
let r21 = create2 r2 r in
let a = fmul acc r21 in
pfadd a.[0] a.[1]
let normalize_4 (r:pfelem) (acc:elem 4) : pfelem =
let r2 = pfmul r r in
let r3 = pfmul r2 r in
let r4 = pfmul r2 r2 in
let r4321 = create4 r4 r3 r2 r in
let a = fmul acc r4321 in
pfadd (pfadd (pfadd a.[0] a.[1]) a.[2]) a.[3]
let normalize_n (#w:lanes) (r:pfelem) (acc:elem w) : pfelem =
match w with
| 1 -> normalize_1 r acc
| 2 -> normalize_2 r acc
| 4 -> normalize_4 r acc
let compute_r1 (r:pfelem) : elem 1 = to_elem 1 r | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compute_r4 (r: pfelem) : elem 4 | [] | Hacl.Spec.Poly1305.Vec.compute_r4 | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | r: Hacl.Spec.Poly1305.Vec.pfelem -> Hacl.Spec.Poly1305.Vec.elem 4 | {
"end_col": 78,
"end_line": 114,
"start_col": 37,
"start_line": 114
} |
Prims.Tot | val compute_r2 (r: pfelem) : elem 2 | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let compute_r2 (r:pfelem) : elem 2 = to_elem 2 (pfmul r r) | val compute_r2 (r: pfelem) : elem 2
let compute_r2 (r: pfelem) : elem 2 = | false | null | false | to_elem 2 (pfmul r r) | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.to_elem",
"Hacl.Spec.Poly1305.Vec.pfmul",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text)
let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc
let normalize_1 (r:pfelem) (acc:elem 1) : pfelem =
pfmul acc.[0] r
let normalize_2 (r:pfelem) (acc:elem 2) : pfelem =
let r2 = pfmul r r in
let r21 = create2 r2 r in
let a = fmul acc r21 in
pfadd a.[0] a.[1]
let normalize_4 (r:pfelem) (acc:elem 4) : pfelem =
let r2 = pfmul r r in
let r3 = pfmul r2 r in
let r4 = pfmul r2 r2 in
let r4321 = create4 r4 r3 r2 r in
let a = fmul acc r4321 in
pfadd (pfadd (pfadd a.[0] a.[1]) a.[2]) a.[3]
let normalize_n (#w:lanes) (r:pfelem) (acc:elem w) : pfelem =
match w with
| 1 -> normalize_1 r acc
| 2 -> normalize_2 r acc
| 4 -> normalize_4 r acc | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compute_r2 (r: pfelem) : elem 2 | [] | Hacl.Spec.Poly1305.Vec.compute_r2 | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | r: Hacl.Spec.Poly1305.Vec.pfelem -> Hacl.Spec.Poly1305.Vec.elem 2 | {
"end_col": 58,
"end_line": 113,
"start_col": 37,
"start_line": 113
} |
Prims.Tot | val load_elem1 (b: Scalar.block) : elem 1 | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b) | val load_elem1 (b: Scalar.block) : elem 1
let load_elem1 (b: Scalar.block) : elem 1 = | false | null | false | to_elem 1 (nat_from_bytes_le b) | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Spec.Poly1305.block",
"Hacl.Spec.Poly1305.Vec.to_elem",
"Lib.ByteSequence.nat_from_bytes_le",
"Lib.IntTypes.SEC",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_elem1 (b: Scalar.block) : elem 1 | [] | Hacl.Spec.Poly1305.Vec.load_elem1 | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | b: Spec.Poly1305.block -> Hacl.Spec.Poly1305.Vec.elem 1 | {
"end_col": 33,
"end_line": 46,
"start_col": 2,
"start_line": 46
} |
Prims.Tot | val load_acc1 (text: lbytes size_block) (acc: pfelem) : elem 1 | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text) | val load_acc1 (text: lbytes size_block) (acc: pfelem) : elem 1
let load_acc1 (text: lbytes size_block) (acc: pfelem) : elem 1 = | false | null | false | let acc = create 1 acc in
fadd acc (load_blocks #1 text) | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Lib.ByteSequence.lbytes",
"Hacl.Spec.Poly1305.Vec.size_block",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.fadd",
"Hacl.Spec.Poly1305.Vec.load_blocks",
"Lib.Sequence.lseq",
"Prims.l_and",
"Prims.eq2",
"FStar.Seq.Base.seq",
"Lib.Sequence.to_seq",
"FStar.Seq.Base.create",
"Prims.l_Forall",
"Prims.nat",
"Prims.l_imp",
"Prims.b2t",
"Prims.op_LessThan",
"Lib.Sequence.index",
"Lib.Sequence.create",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_acc1 (text: lbytes size_block) (acc: pfelem) : elem 1 | [] | Hacl.Spec.Poly1305.Vec.load_acc1 | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
text: Lib.ByteSequence.lbytes Hacl.Spec.Poly1305.Vec.size_block ->
acc: Hacl.Spec.Poly1305.Vec.pfelem
-> Hacl.Spec.Poly1305.Vec.elem 1 | {
"end_col": 32,
"end_line": 73,
"start_col": 62,
"start_line": 71
} |
Prims.Tot | val compute_r1 (r: pfelem) : elem 1 | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let compute_r1 (r:pfelem) : elem 1 = to_elem 1 r | val compute_r1 (r: pfelem) : elem 1
let compute_r1 (r: pfelem) : elem 1 = | false | null | false | to_elem 1 r | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.to_elem",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text)
let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc
let normalize_1 (r:pfelem) (acc:elem 1) : pfelem =
pfmul acc.[0] r
let normalize_2 (r:pfelem) (acc:elem 2) : pfelem =
let r2 = pfmul r r in
let r21 = create2 r2 r in
let a = fmul acc r21 in
pfadd a.[0] a.[1]
let normalize_4 (r:pfelem) (acc:elem 4) : pfelem =
let r2 = pfmul r r in
let r3 = pfmul r2 r in
let r4 = pfmul r2 r2 in
let r4321 = create4 r4 r3 r2 r in
let a = fmul acc r4321 in
pfadd (pfadd (pfadd a.[0] a.[1]) a.[2]) a.[3]
let normalize_n (#w:lanes) (r:pfelem) (acc:elem w) : pfelem =
match w with
| 1 -> normalize_1 r acc
| 2 -> normalize_2 r acc
| 4 -> normalize_4 r acc | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val compute_r1 (r: pfelem) : elem 1 | [] | Hacl.Spec.Poly1305.Vec.compute_r1 | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | r: Hacl.Spec.Poly1305.Vec.pfelem -> Hacl.Spec.Poly1305.Vec.elem 1 | {
"end_col": 48,
"end_line": 112,
"start_col": 37,
"start_line": 112
} |
Prims.Tot | val load_acc2 (text: lbytes (2 * size_block)) (acc: pfelem) : elem 2 | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text) | val load_acc2 (text: lbytes (2 * size_block)) (acc: pfelem) : elem 2
let load_acc2 (text: lbytes (2 * size_block)) (acc: pfelem) : elem 2 = | false | null | false | let acc = create2 acc 0 in
fadd acc (load_blocks #2 text) | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Lib.ByteSequence.lbytes",
"FStar.Mul.op_Star",
"Hacl.Spec.Poly1305.Vec.size_block",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.fadd",
"Hacl.Spec.Poly1305.Vec.load_blocks",
"Lib.Sequence.lseq",
"Lib.Sequence.create2",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text) | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_acc2 (text: lbytes (2 * size_block)) (acc: pfelem) : elem 2 | [] | Hacl.Spec.Poly1305.Vec.load_acc2 | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
text: Lib.ByteSequence.lbytes (2 * Hacl.Spec.Poly1305.Vec.size_block) ->
acc: Hacl.Spec.Poly1305.Vec.pfelem
-> Hacl.Spec.Poly1305.Vec.elem 2 | {
"end_col": 32,
"end_line": 77,
"start_col": 68,
"start_line": 75
} |
Prims.Tot | val poly1305_update_vec (#w: lanes) (text: bytes) (acc r: pfelem) : pfelem | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let poly1305_update_vec (#w:lanes) (text:bytes) (acc:pfelem) (r:pfelem) : pfelem =
let len = length text in
let sz_block = w * size_block in
let len0 = len / sz_block * sz_block in
let t0 = Seq.slice text 0 len0 in
let acc = if len0 > 0 then poly1305_update_multi #w t0 acc r else acc in
let t1 = Seq.slice text len0 len in
Scalar.poly1305_update t1 acc r | val poly1305_update_vec (#w: lanes) (text: bytes) (acc r: pfelem) : pfelem
let poly1305_update_vec (#w: lanes) (text: bytes) (acc r: pfelem) : pfelem = | false | null | false | let len = length text in
let sz_block = w * size_block in
let len0 = (len / sz_block) * sz_block in
let t0 = Seq.slice text 0 len0 in
let acc = if len0 > 0 then poly1305_update_multi #w t0 acc r else acc in
let t1 = Seq.slice text len0 len in
Scalar.poly1305_update t1 acc r | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Lib.ByteSequence.bytes",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Spec.Poly1305.poly1305_update",
"FStar.Seq.Base.seq",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"FStar.Seq.Base.slice",
"Lib.IntTypes.uint_t",
"Spec.Poly1305.felem",
"Prims.op_GreaterThan",
"Hacl.Spec.Poly1305.Vec.poly1305_update_multi",
"Prims.bool",
"Prims.int",
"FStar.Mul.op_Star",
"Prims.op_Division",
"Hacl.Spec.Poly1305.Vec.size_block",
"Prims.nat",
"Lib.Sequence.length"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text)
let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc
let normalize_1 (r:pfelem) (acc:elem 1) : pfelem =
pfmul acc.[0] r
let normalize_2 (r:pfelem) (acc:elem 2) : pfelem =
let r2 = pfmul r r in
let r21 = create2 r2 r in
let a = fmul acc r21 in
pfadd a.[0] a.[1]
let normalize_4 (r:pfelem) (acc:elem 4) : pfelem =
let r2 = pfmul r r in
let r3 = pfmul r2 r in
let r4 = pfmul r2 r2 in
let r4321 = create4 r4 r3 r2 r in
let a = fmul acc r4321 in
pfadd (pfadd (pfadd a.[0] a.[1]) a.[2]) a.[3]
let normalize_n (#w:lanes) (r:pfelem) (acc:elem w) : pfelem =
match w with
| 1 -> normalize_1 r acc
| 2 -> normalize_2 r acc
| 4 -> normalize_4 r acc
let compute_r1 (r:pfelem) : elem 1 = to_elem 1 r
let compute_r2 (r:pfelem) : elem 2 = to_elem 2 (pfmul r r)
let compute_r4 (r:pfelem) : elem 4 = to_elem 4 (pfmul (pfmul r r) (pfmul r r))
let compute_rw (#w:lanes) (r:pfelem) : elem w =
match w with
| 1 -> compute_r1 r
| 2 -> compute_r2 r
| 4 -> compute_r4 r
let poly1305_update_nblocks (#w:lanes) (r_w:elem w) (b:lbytes (w * size_block)) (acc:elem w) : elem w =
let e = load_blocks b in
let acc = fadd (fmul acc r_w) e in
acc
let poly1305_update_multi (#w:lanes) (text:bytes{0 < length text /\ length text % (w * size_block) = 0}) (acc:pfelem) (r:pfelem) : pfelem =
let rw = compute_rw r in
let acc = load_acc (Seq.slice text 0 (w * size_block)) acc in
let text = Seq.slice text (w * size_block) (length text) in
let acc = repeat_blocks_multi #uint8 #(elem w) (w * size_block) text (poly1305_update_nblocks rw) acc in
let acc = normalize_n r acc in
acc | false | true | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val poly1305_update_vec (#w: lanes) (text: bytes) (acc r: pfelem) : pfelem | [] | Hacl.Spec.Poly1305.Vec.poly1305_update_vec | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
text: Lib.ByteSequence.bytes ->
acc: Hacl.Spec.Poly1305.Vec.pfelem ->
r: Hacl.Spec.Poly1305.Vec.pfelem
-> Hacl.Spec.Poly1305.Vec.pfelem | {
"end_col": 33,
"end_line": 145,
"start_col": 82,
"start_line": 137
} |
Prims.Tot | val poly1305_update_nblocks (#w: lanes) (r_w: elem w) (b: lbytes (w * size_block)) (acc: elem w)
: elem w | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let poly1305_update_nblocks (#w:lanes) (r_w:elem w) (b:lbytes (w * size_block)) (acc:elem w) : elem w =
let e = load_blocks b in
let acc = fadd (fmul acc r_w) e in
acc | val poly1305_update_nblocks (#w: lanes) (r_w: elem w) (b: lbytes (w * size_block)) (acc: elem w)
: elem w
let poly1305_update_nblocks (#w: lanes) (r_w: elem w) (b: lbytes (w * size_block)) (acc: elem w)
: elem w = | false | null | false | let e = load_blocks b in
let acc = fadd (fmul acc r_w) e in
acc | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Hacl.Spec.Poly1305.Vec.elem",
"Lib.ByteSequence.lbytes",
"FStar.Mul.op_Star",
"Hacl.Spec.Poly1305.Vec.size_block",
"Hacl.Spec.Poly1305.Vec.fadd",
"Hacl.Spec.Poly1305.Vec.fmul",
"Hacl.Spec.Poly1305.Vec.load_blocks"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text)
let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc
let normalize_1 (r:pfelem) (acc:elem 1) : pfelem =
pfmul acc.[0] r
let normalize_2 (r:pfelem) (acc:elem 2) : pfelem =
let r2 = pfmul r r in
let r21 = create2 r2 r in
let a = fmul acc r21 in
pfadd a.[0] a.[1]
let normalize_4 (r:pfelem) (acc:elem 4) : pfelem =
let r2 = pfmul r r in
let r3 = pfmul r2 r in
let r4 = pfmul r2 r2 in
let r4321 = create4 r4 r3 r2 r in
let a = fmul acc r4321 in
pfadd (pfadd (pfadd a.[0] a.[1]) a.[2]) a.[3]
let normalize_n (#w:lanes) (r:pfelem) (acc:elem w) : pfelem =
match w with
| 1 -> normalize_1 r acc
| 2 -> normalize_2 r acc
| 4 -> normalize_4 r acc
let compute_r1 (r:pfelem) : elem 1 = to_elem 1 r
let compute_r2 (r:pfelem) : elem 2 = to_elem 2 (pfmul r r)
let compute_r4 (r:pfelem) : elem 4 = to_elem 4 (pfmul (pfmul r r) (pfmul r r))
let compute_rw (#w:lanes) (r:pfelem) : elem w =
match w with
| 1 -> compute_r1 r
| 2 -> compute_r2 r
| 4 -> compute_r4 r | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val poly1305_update_nblocks (#w: lanes) (r_w: elem w) (b: lbytes (w * size_block)) (acc: elem w)
: elem w | [] | Hacl.Spec.Poly1305.Vec.poly1305_update_nblocks | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
r_w: Hacl.Spec.Poly1305.Vec.elem w ->
b: Lib.ByteSequence.lbytes (w * Hacl.Spec.Poly1305.Vec.size_block) ->
acc: Hacl.Spec.Poly1305.Vec.elem w
-> Hacl.Spec.Poly1305.Vec.elem w | {
"end_col": 5,
"end_line": 125,
"start_col": 103,
"start_line": 122
} |
Prims.Tot | val normalize_1 (r: pfelem) (acc: elem 1) : pfelem | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let normalize_1 (r:pfelem) (acc:elem 1) : pfelem =
pfmul acc.[0] r | val normalize_1 (r: pfelem) (acc: elem 1) : pfelem
let normalize_1 (r: pfelem) (acc: elem 1) : pfelem = | false | null | false | pfmul acc.[ 0 ] r | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.elem",
"Hacl.Spec.Poly1305.Vec.pfmul",
"Lib.Sequence.op_String_Access"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text)
let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val normalize_1 (r: pfelem) (acc: elem 1) : pfelem | [] | Hacl.Spec.Poly1305.Vec.normalize_1 | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | r: Hacl.Spec.Poly1305.Vec.pfelem -> acc: Hacl.Spec.Poly1305.Vec.elem 1
-> Hacl.Spec.Poly1305.Vec.pfelem | {
"end_col": 17,
"end_line": 90,
"start_col": 2,
"start_line": 90
} |
Prims.Tot | val normalize_4 (r: pfelem) (acc: elem 4) : pfelem | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let normalize_4 (r:pfelem) (acc:elem 4) : pfelem =
let r2 = pfmul r r in
let r3 = pfmul r2 r in
let r4 = pfmul r2 r2 in
let r4321 = create4 r4 r3 r2 r in
let a = fmul acc r4321 in
pfadd (pfadd (pfadd a.[0] a.[1]) a.[2]) a.[3] | val normalize_4 (r: pfelem) (acc: elem 4) : pfelem
let normalize_4 (r: pfelem) (acc: elem 4) : pfelem = | false | null | false | let r2 = pfmul r r in
let r3 = pfmul r2 r in
let r4 = pfmul r2 r2 in
let r4321 = create4 r4 r3 r2 r in
let a = fmul acc r4321 in
pfadd (pfadd (pfadd a.[ 0 ] a.[ 1 ]) a.[ 2 ]) a.[ 3 ] | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.elem",
"Hacl.Spec.Poly1305.Vec.pfadd",
"Lib.Sequence.op_String_Access",
"Hacl.Spec.Poly1305.Vec.fmul",
"Lib.Sequence.lseq",
"Lib.Sequence.create4",
"Hacl.Spec.Poly1305.Vec.pfmul"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text)
let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc
let normalize_1 (r:pfelem) (acc:elem 1) : pfelem =
pfmul acc.[0] r
let normalize_2 (r:pfelem) (acc:elem 2) : pfelem =
let r2 = pfmul r r in
let r21 = create2 r2 r in
let a = fmul acc r21 in
pfadd a.[0] a.[1] | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val normalize_4 (r: pfelem) (acc: elem 4) : pfelem | [] | Hacl.Spec.Poly1305.Vec.normalize_4 | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | r: Hacl.Spec.Poly1305.Vec.pfelem -> acc: Hacl.Spec.Poly1305.Vec.elem 4
-> Hacl.Spec.Poly1305.Vec.pfelem | {
"end_col": 47,
"end_line": 104,
"start_col": 50,
"start_line": 98
} |
Prims.Tot | val load_elem2 (b: lbytes (2 * size_block)) : elem 2 | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2 | val load_elem2 (b: lbytes (2 * size_block)) : elem 2
let load_elem2 (b: lbytes (2 * size_block)) : elem 2 = | false | null | false | let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2 | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Lib.ByteSequence.lbytes",
"FStar.Mul.op_Star",
"Hacl.Spec.Poly1305.Vec.size_block",
"Lib.Sequence.create2",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.pow2",
"Prims.op_Multiply",
"Lib.Sequence.length",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Lib.Sequence.sub",
"Lib.ByteSequence.nat_from_bytes_le",
"Lib.IntTypes.uint_t",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b) | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_elem2 (b: lbytes (2 * size_block)) : elem 2 | [] | Hacl.Spec.Poly1305.Vec.load_elem2 | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | b: Lib.ByteSequence.lbytes (2 * Hacl.Spec.Poly1305.Vec.size_block) -> Hacl.Spec.Poly1305.Vec.elem 2 | {
"end_col": 15,
"end_line": 51,
"start_col": 53,
"start_line": 48
} |
Prims.Tot | val load_acc4 (text: lbytes (4 * size_block)) (acc: pfelem) : elem 4 | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text) | val load_acc4 (text: lbytes (4 * size_block)) (acc: pfelem) : elem 4
let load_acc4 (text: lbytes (4 * size_block)) (acc: pfelem) : elem 4 = | false | null | false | let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text) | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Lib.ByteSequence.lbytes",
"FStar.Mul.op_Star",
"Hacl.Spec.Poly1305.Vec.size_block",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.fadd",
"Hacl.Spec.Poly1305.Vec.load_blocks",
"Lib.Sequence.lseq",
"Lib.Sequence.create4",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text) | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_acc4 (text: lbytes (4 * size_block)) (acc: pfelem) : elem 4 | [] | Hacl.Spec.Poly1305.Vec.load_acc4 | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
text: Lib.ByteSequence.lbytes (4 * Hacl.Spec.Poly1305.Vec.size_block) ->
acc: Hacl.Spec.Poly1305.Vec.pfelem
-> Hacl.Spec.Poly1305.Vec.elem 4 | {
"end_col": 32,
"end_line": 81,
"start_col": 68,
"start_line": 79
} |
Prims.Tot | val normalize_2 (r: pfelem) (acc: elem 2) : pfelem | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let normalize_2 (r:pfelem) (acc:elem 2) : pfelem =
let r2 = pfmul r r in
let r21 = create2 r2 r in
let a = fmul acc r21 in
pfadd a.[0] a.[1] | val normalize_2 (r: pfelem) (acc: elem 2) : pfelem
let normalize_2 (r: pfelem) (acc: elem 2) : pfelem = | false | null | false | let r2 = pfmul r r in
let r21 = create2 r2 r in
let a = fmul acc r21 in
pfadd a.[ 0 ] a.[ 1 ] | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.elem",
"Hacl.Spec.Poly1305.Vec.pfadd",
"Lib.Sequence.op_String_Access",
"Hacl.Spec.Poly1305.Vec.fmul",
"Lib.Sequence.lseq",
"Lib.Sequence.create2",
"Hacl.Spec.Poly1305.Vec.pfmul"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text)
let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc
let normalize_1 (r:pfelem) (acc:elem 1) : pfelem =
pfmul acc.[0] r | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val normalize_2 (r: pfelem) (acc: elem 2) : pfelem | [] | Hacl.Spec.Poly1305.Vec.normalize_2 | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | r: Hacl.Spec.Poly1305.Vec.pfelem -> acc: Hacl.Spec.Poly1305.Vec.elem 2
-> Hacl.Spec.Poly1305.Vec.pfelem | {
"end_col": 19,
"end_line": 96,
"start_col": 50,
"start_line": 92
} |
Prims.Tot | val load_acc (#w: lanes) (text: lbytes (w * size_block)) (acc: pfelem) : elem w | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc | val load_acc (#w: lanes) (text: lbytes (w * size_block)) (acc: pfelem) : elem w
let load_acc (#w: lanes) (text: lbytes (w * size_block)) (acc: pfelem) : elem w = | false | null | false | match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Lib.ByteSequence.lbytes",
"FStar.Mul.op_Star",
"Hacl.Spec.Poly1305.Vec.size_block",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.load_acc1",
"Hacl.Spec.Poly1305.Vec.load_acc2",
"Hacl.Spec.Poly1305.Vec.load_acc4",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text) | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_acc (#w: lanes) (text: lbytes (w * size_block)) (acc: pfelem) : elem w | [] | Hacl.Spec.Poly1305.Vec.load_acc | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
text: Lib.ByteSequence.lbytes (w * Hacl.Spec.Poly1305.Vec.size_block) ->
acc: Hacl.Spec.Poly1305.Vec.pfelem
-> Hacl.Spec.Poly1305.Vec.elem w | {
"end_col": 27,
"end_line": 87,
"start_col": 2,
"start_line": 84
} |
Prims.Tot | val load_elem (#w: lanes) (b: lbytes (w * size_block)) : elem w | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b | val load_elem (#w: lanes) (b: lbytes (w * size_block)) : elem w
let load_elem (#w: lanes) (b: lbytes (w * size_block)) : elem w = | false | null | false | match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Lib.ByteSequence.lbytes",
"FStar.Mul.op_Star",
"Hacl.Spec.Poly1305.Vec.size_block",
"Hacl.Spec.Poly1305.Vec.load_elem1",
"Hacl.Spec.Poly1305.Vec.load_elem2",
"Hacl.Spec.Poly1305.Vec.load_elem4",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4 | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_elem (#w: lanes) (b: lbytes (w * size_block)) : elem w | [] | Hacl.Spec.Poly1305.Vec.load_elem | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | b: Lib.ByteSequence.lbytes (w * Hacl.Spec.Poly1305.Vec.size_block) -> Hacl.Spec.Poly1305.Vec.elem w | {
"end_col": 21,
"end_line": 64,
"start_col": 2,
"start_line": 61
} |
Prims.Tot | val load_blocks (#w: lanes) (b: lbytes (w * size_block)) : elem w | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e | val load_blocks (#w: lanes) (b: lbytes (w * size_block)) : elem w
let load_blocks (#w: lanes) (b: lbytes (w * size_block)) : elem w = | false | null | false | let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Lib.ByteSequence.lbytes",
"FStar.Mul.op_Star",
"Hacl.Spec.Poly1305.Vec.size_block",
"Lib.Sequence.lseq",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Prims.l_Forall",
"Prims.nat",
"Prims.l_imp",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.eq2",
"Lib.Sequence.index",
"Hacl.Spec.Poly1305.Vec.pfadd",
"Prims.pow2",
"Lib.Sequence.map",
"Hacl.Spec.Poly1305.Vec.elem",
"Hacl.Spec.Poly1305.Vec.load_elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_blocks (#w: lanes) (b: lbytes (w * size_block)) : elem w | [] | Hacl.Spec.Poly1305.Vec.load_blocks | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | b: Lib.ByteSequence.lbytes (w * Hacl.Spec.Poly1305.Vec.size_block) -> Hacl.Spec.Poly1305.Vec.elem w | {
"end_col": 3,
"end_line": 69,
"start_col": 65,
"start_line": 66
} |
Prims.Tot | val load_elem4 (b: lbytes (4 * size_block)) : elem 4 | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4 | val load_elem4 (b: lbytes (4 * size_block)) : elem 4
let load_elem4 (b: lbytes (4 * size_block)) : elem 4 = | false | null | false | let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4 | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Lib.ByteSequence.lbytes",
"FStar.Mul.op_Star",
"Hacl.Spec.Poly1305.Vec.size_block",
"Lib.Sequence.create4",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Prims.nat",
"Prims.b2t",
"Prims.op_LessThan",
"Prims.pow2",
"Prims.op_Multiply",
"Lib.Sequence.length",
"Lib.IntTypes.int_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Lib.Sequence.sub",
"Lib.ByteSequence.nat_from_bytes_le",
"Lib.IntTypes.uint_t",
"Hacl.Spec.Poly1305.Vec.elem"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2 | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val load_elem4 (b: lbytes (4 * size_block)) : elem 4 | [] | Hacl.Spec.Poly1305.Vec.load_elem4 | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | b: Lib.ByteSequence.lbytes (4 * Hacl.Spec.Poly1305.Vec.size_block) -> Hacl.Spec.Poly1305.Vec.elem 4 | {
"end_col": 21,
"end_line": 58,
"start_col": 53,
"start_line": 53
} |
Prims.Tot | val poly1305_update_multi
(#w: lanes)
(text: bytes{0 < length text /\ length text % (w * size_block) = 0})
(acc r: pfelem)
: pfelem | [
{
"abbrev": true,
"full_module": "Spec.Poly1305",
"short_module": "Scalar"
},
{
"abbrev": false,
"full_module": "Lib.IntVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.ByteSequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.Sequence",
"short_module": null
},
{
"abbrev": false,
"full_module": "Lib.IntTypes",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Mul",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "Hacl.Spec.Poly1305",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let poly1305_update_multi (#w:lanes) (text:bytes{0 < length text /\ length text % (w * size_block) = 0}) (acc:pfelem) (r:pfelem) : pfelem =
let rw = compute_rw r in
let acc = load_acc (Seq.slice text 0 (w * size_block)) acc in
let text = Seq.slice text (w * size_block) (length text) in
let acc = repeat_blocks_multi #uint8 #(elem w) (w * size_block) text (poly1305_update_nblocks rw) acc in
let acc = normalize_n r acc in
acc | val poly1305_update_multi
(#w: lanes)
(text: bytes{0 < length text /\ length text % (w * size_block) = 0})
(acc r: pfelem)
: pfelem
let poly1305_update_multi
(#w: lanes)
(text: bytes{0 < length text /\ length text % (w * size_block) = 0})
(acc r: pfelem)
: pfelem = | false | null | false | let rw = compute_rw r in
let acc = load_acc (Seq.slice text 0 (w * size_block)) acc in
let text = Seq.slice text (w * size_block) (length text) in
let acc =
repeat_blocks_multi #uint8 #(elem w) (w * size_block) text (poly1305_update_nblocks rw) acc
in
let acc = normalize_n r acc in
acc | {
"checked_file": "Hacl.Spec.Poly1305.Vec.fst.checked",
"dependencies": [
"Spec.Poly1305.fst.checked",
"prims.fst.checked",
"Lib.Sequence.fsti.checked",
"Lib.IntVector.fsti.checked",
"Lib.IntTypes.fsti.checked",
"Lib.ByteSequence.fsti.checked",
"FStar.Seq.fst.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Mul.fst.checked",
"FStar.Math.Lemmas.fst.checked"
],
"interface_file": false,
"source_file": "Hacl.Spec.Poly1305.Vec.fst"
} | [
"total"
] | [
"Hacl.Spec.Poly1305.Vec.lanes",
"Lib.ByteSequence.bytes",
"Prims.l_and",
"Prims.b2t",
"Prims.op_LessThan",
"Lib.Sequence.length",
"Lib.IntTypes.uint_t",
"Lib.IntTypes.U8",
"Lib.IntTypes.SEC",
"Prims.op_Equality",
"Prims.int",
"Prims.op_Modulus",
"FStar.Mul.op_Star",
"Hacl.Spec.Poly1305.Vec.size_block",
"Hacl.Spec.Poly1305.Vec.pfelem",
"Hacl.Spec.Poly1305.Vec.normalize_n",
"Hacl.Spec.Poly1305.Vec.elem",
"Lib.Sequence.repeat_blocks_multi",
"Lib.IntTypes.uint8",
"Hacl.Spec.Poly1305.Vec.poly1305_update_nblocks",
"FStar.Seq.Base.seq",
"Lib.IntTypes.int_t",
"FStar.Seq.Base.slice",
"Hacl.Spec.Poly1305.Vec.load_acc",
"Hacl.Spec.Poly1305.Vec.compute_rw"
] | [] | module Hacl.Spec.Poly1305.Vec
#reset-options "--z3rlimit 60 --initial_fuel 0 --max_fuel 0 --initial_ifuel 0 --max_ifuel 0"
open FStar.Mul
open Lib.IntTypes
open Lib.Sequence
open Lib.ByteSequence
open Lib.IntVector
module Scalar = Spec.Poly1305
(* Field types and parameters *)
val lemma_pow2_128: n:nat ->
Lemma
(requires n <= 128)
(ensures pow2 n < Scalar.prime)
[SMTPat (pow2 n)]
let lemma_pow2_128 n =
Math.Lemmas.pow2_le_compat 128 n;
assert (pow2 n <= pow2 128);
assert_norm (pow2 128 < Scalar.prime)
let prime = Scalar.prime
let pfelem = Scalar.felem
let pfadd (x:pfelem) (y:pfelem) : pfelem = Scalar.fadd x y
let pfmul (x:pfelem) (y:pfelem) : pfelem = Scalar.fmul x y
let lanes = w:width{w == 1 \/ w == 2 \/ w == 4}
type elem (w:lanes) = lseq pfelem w
let to_elem (w:lanes) (x:pfelem) : elem w = create w x
let from_elem (#w:lanes) (x:elem w) : pfelem = x.[0]
let zero (w:lanes) : elem w = to_elem w 0
let fadd (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfadd x y
let fmul (#w:lanes) (x:elem w) (y:elem w) : elem w =
map2 pfmul x y
(* Specification *)
let size_block : size_nat = Scalar.size_block
let load_elem1 (b:Scalar.block) : elem 1 =
to_elem 1 (nat_from_bytes_le b)
let load_elem2 (b:lbytes (2 * size_block)) : elem 2 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
create2 b1 b2
let load_elem4 (b:lbytes (4 * size_block)) : elem 4 =
let b1 = nat_from_bytes_le (sub b 0 size_block) in
let b2 = nat_from_bytes_le (sub b size_block size_block) in
let b3 = nat_from_bytes_le (sub b (2 * size_block) size_block) in
let b4 = nat_from_bytes_le (sub b (3 * size_block) size_block) in
create4 b1 b2 b3 b4
let load_elem (#w:lanes) (b:lbytes (w * size_block)) : elem w =
match w with
| 1 -> load_elem1 b
| 2 -> load_elem2 b
| 4 -> load_elem4 b
let load_blocks (#w:lanes) (b:lbytes (w * size_block)) : elem w =
let e = load_elem #w b in
let e = map (pfadd (pow2 128)) e in
e
let load_acc1 (text:lbytes size_block) (acc:pfelem) : elem 1 =
let acc = create 1 acc in
fadd acc (load_blocks #1 text)
let load_acc2 (text:lbytes (2 * size_block)) (acc:pfelem) : elem 2 =
let acc = create2 acc 0 in
fadd acc (load_blocks #2 text)
let load_acc4 (text:lbytes (4 * size_block)) (acc:pfelem) : elem 4 =
let acc = create4 acc 0 0 0 in
fadd acc (load_blocks #4 text)
let load_acc (#w:lanes) (text:lbytes (w * size_block)) (acc:pfelem) : elem w =
match w with
| 1 -> load_acc1 text acc
| 2 -> load_acc2 text acc
| 4 -> load_acc4 text acc
let normalize_1 (r:pfelem) (acc:elem 1) : pfelem =
pfmul acc.[0] r
let normalize_2 (r:pfelem) (acc:elem 2) : pfelem =
let r2 = pfmul r r in
let r21 = create2 r2 r in
let a = fmul acc r21 in
pfadd a.[0] a.[1]
let normalize_4 (r:pfelem) (acc:elem 4) : pfelem =
let r2 = pfmul r r in
let r3 = pfmul r2 r in
let r4 = pfmul r2 r2 in
let r4321 = create4 r4 r3 r2 r in
let a = fmul acc r4321 in
pfadd (pfadd (pfadd a.[0] a.[1]) a.[2]) a.[3]
let normalize_n (#w:lanes) (r:pfelem) (acc:elem w) : pfelem =
match w with
| 1 -> normalize_1 r acc
| 2 -> normalize_2 r acc
| 4 -> normalize_4 r acc
let compute_r1 (r:pfelem) : elem 1 = to_elem 1 r
let compute_r2 (r:pfelem) : elem 2 = to_elem 2 (pfmul r r)
let compute_r4 (r:pfelem) : elem 4 = to_elem 4 (pfmul (pfmul r r) (pfmul r r))
let compute_rw (#w:lanes) (r:pfelem) : elem w =
match w with
| 1 -> compute_r1 r
| 2 -> compute_r2 r
| 4 -> compute_r4 r
let poly1305_update_nblocks (#w:lanes) (r_w:elem w) (b:lbytes (w * size_block)) (acc:elem w) : elem w =
let e = load_blocks b in
let acc = fadd (fmul acc r_w) e in
acc | false | false | Hacl.Spec.Poly1305.Vec.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": 60,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val poly1305_update_multi
(#w: lanes)
(text: bytes{0 < length text /\ length text % (w * size_block) = 0})
(acc r: pfelem)
: pfelem | [] | Hacl.Spec.Poly1305.Vec.poly1305_update_multi | {
"file_name": "code/poly1305/Hacl.Spec.Poly1305.Vec.fst",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
text:
Lib.ByteSequence.bytes
{ 0 < Lib.Sequence.length text /\
Lib.Sequence.length text % (w * Hacl.Spec.Poly1305.Vec.size_block) = 0 } ->
acc: Hacl.Spec.Poly1305.Vec.pfelem ->
r: Hacl.Spec.Poly1305.Vec.pfelem
-> Hacl.Spec.Poly1305.Vec.pfelem | {
"end_col": 5,
"end_line": 134,
"start_col": 139,
"start_line": 128
} |
Prims.Tot | val va_wp_ShiftLeft128_1 (a: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_v1:quad32) (va_x_v2:quad32) . let va_sM =
va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 va_s0) in va_get_ok va_sM /\ va_get_vec 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (()))) | val va_wp_ShiftLeft128_1 (a: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
let va_wp_ShiftLeft128_1 (a: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 = | false | null | false | (va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a < 128 /\
va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a /\
(forall (va_x_v1: quad32) (va_x_v2: quad32).
let va_sM = va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 va_s0) in
va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==>
va_k va_sM (()))) | {
"checked_file": "Vale.AES.PPC64LE.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCodes.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsVector.fsti.checked",
"Vale.PPC64LE.InsMem.fsti.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.TypesNative.fsti.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.Types_helpers.fsti.checked",
"Vale.AES.PPC64LE.PolyOps.fsti.checked",
"Vale.AES.GHash_BE.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.PPC64LE.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.Math.Poly2_s.poly",
"Vale.PPC64LE.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Vale.PPC64LE.Decls.va_get_ok",
"Prims.op_LessThan",
"Vale.Math.Poly2_s.degree",
"Prims.eq2",
"Vale.Def.Types_s.quad32",
"Vale.PPC64LE.Decls.va_get_vec",
"Vale.Math.Poly2.Bits_s.to_quad32",
"Prims.l_Forall",
"Vale.PPC64LE.Machine_s.quad32",
"Prims.l_imp",
"Vale.Math.Poly2_s.shift",
"Vale.PPC64LE.Machine_s.state",
"Vale.PPC64LE.Decls.va_upd_vec"
] | [] | module Vale.AES.PPC64LE.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Arch.TypesNative
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.InsBasic
open Vale.PPC64LE.InsMem
open Vale.PPC64LE.InsVector
open Vale.PPC64LE.QuickCode
open Vale.PPC64LE.QuickCodes
open Vale.AES.PPC64LE.PolyOps
open Vale.AES.Types_helpers
open Vale.AES.GHash_BE
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0)))))
[@ va_qattr] | false | true | Vale.AES.PPC64LE.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wp_ShiftLeft128_1 (a: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [] | Vale.AES.PPC64LE.GF128_Mul.va_wp_ShiftLeft128_1 | {
"file_name": "obj/Vale.AES.PPC64LE.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Vale.Math.Poly2_s.poly ->
va_s0: Vale.PPC64LE.Decls.va_state ->
va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | {
"end_col": 88,
"end_line": 41,
"start_col": 2,
"start_line": 38
} |
Prims.Tot | val va_wp_High64ToLow
(dst src: va_operand_vec_opr)
(a: poly)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | [
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wp_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.div a (Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (()))) | val va_wp_High64ToLow
(dst src: va_operand_vec_opr)
(a: poly)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0
let va_wp_High64ToLow
(dst src: va_operand_vec_opr)
(a: poly)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 = | false | null | false | (va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\
va_get_vec 0 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\
Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\
(forall (va_x_dst: va_value_vec_opr).
let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\
va_eval_vec_opr va_sM dst ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.div a (Vale.Math.Poly2_s.monomial 64)) ==>
va_k va_sM (()))) | {
"checked_file": "Vale.AES.PPC64LE.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCodes.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsVector.fsti.checked",
"Vale.PPC64LE.InsMem.fsti.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.TypesNative.fsti.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.Types_helpers.fsti.checked",
"Vale.AES.PPC64LE.PolyOps.fsti.checked",
"Vale.AES.GHash_BE.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.PPC64LE.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Decls.va_operand_vec_opr",
"Vale.Math.Poly2_s.poly",
"Vale.PPC64LE.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Vale.PPC64LE.Decls.va_is_dst_vec_opr",
"Vale.PPC64LE.Decls.va_is_src_vec_opr",
"Prims.b2t",
"Vale.PPC64LE.Decls.va_get_ok",
"Prims.eq2",
"Vale.Def.Words_s.four",
"Vale.Def.Types_s.nat32",
"Vale.PPC64LE.Decls.va_get_vec",
"Vale.Def.Words_s.Mkfour",
"Prims.op_LessThanOrEqual",
"Vale.Math.Poly2_s.degree",
"Vale.Def.Types_s.quad32",
"Vale.PPC64LE.Decls.va_eval_vec_opr",
"Vale.Math.Poly2.Bits_s.to_quad32",
"Prims.l_Forall",
"Vale.PPC64LE.Decls.va_value_vec_opr",
"Prims.l_imp",
"Vale.Math.Poly2_s.div",
"Vale.Math.Poly2_s.monomial",
"Vale.PPC64LE.Machine_s.state",
"Vale.PPC64LE.Decls.va_upd_operand_vec_opr"
] | [] | module Vale.AES.PPC64LE.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Arch.TypesNative
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.InsBasic
open Vale.PPC64LE.InsMem
open Vale.PPC64LE.InsVector
open Vale.PPC64LE.QuickCode
open Vale.PPC64LE.QuickCodes
open Vale.AES.PPC64LE.PolyOps
open Vale.AES.Types_helpers
open Vale.AES.GHash_BE
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0)))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_v1:quad32) (va_x_v2:quad32) . let va_sM =
va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 va_s0) in va_get_ok va_sM /\ va_get_vec 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2;
va_Mod_vec 1]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2; va_Mod_vec 1]) (va_wp_ShiftLeft128_1 a)
(va_wpProof_ShiftLeft128_1 a))
//--
//-- High64ToLow
val va_code_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_High64ToLow : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_High64ToLow dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.div a
(Vale.Math.Poly2_s.monomial 64)) /\ va_state_eq va_sM (va_update_ok va_sM
(va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state) | false | true | Vale.AES.PPC64LE.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wp_High64ToLow
(dst src: va_operand_vec_opr)
(a: poly)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | [] | Vale.AES.PPC64LE.GF128_Mul.va_wp_High64ToLow | {
"file_name": "obj/Vale.AES.PPC64LE.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.PPC64LE.Decls.va_operand_vec_opr ->
src: Vale.PPC64LE.Decls.va_operand_vec_opr ->
a: Vale.Math.Poly2_s.poly ->
va_s0: Vale.PPC64LE.Decls.va_state ->
va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | {
"end_col": 83,
"end_line": 79,
"start_col": 2,
"start_line": 74
} |
Prims.Tot | val va_wp_Gf128MulRev128 (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wp_Gf128MulRev128 (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32)
(va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) . let va_sM = va_upd_vec 6
va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2
(va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0))))))) in va_get_ok
va_sM /\ (let (a:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1
va_s0) in let (b:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 2
va_s0) in Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1 va_sM) == Vale.AES.GF128.gf128_mul_rev
a b) ==> va_k va_sM (()))) | val va_wp_Gf128MulRev128 (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
let va_wp_Gf128MulRev128 (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 = | false | null | false | (va_get_ok va_s0 /\
(forall (va_x_r10: nat64)
(va_x_v0: quad32)
(va_x_v1: quad32)
(va_x_v2: quad32)
(va_x_v3: quad32)
(va_x_v4: quad32)
(va_x_v5: quad32)
(va_x_v6: quad32).
let va_sM =
va_upd_vec 6
va_x_v6
(va_upd_vec 5
va_x_v5
(va_upd_vec 4
va_x_v4
(va_upd_vec 3
va_x_v3
(va_upd_vec 2
va_x_v2
(va_upd_vec 1
va_x_v1
(va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)))))))
in
va_get_ok va_sM /\
(let a:Vale.Math.Poly2_s.poly = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1 va_s0) in
let b:Vale.Math.Poly2_s.poly = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 2 va_s0) in
Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1 va_sM) == Vale.AES.GF128.gf128_mul_rev a b) ==>
va_k va_sM (()))) | {
"checked_file": "Vale.AES.PPC64LE.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCodes.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsVector.fsti.checked",
"Vale.PPC64LE.InsMem.fsti.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.TypesNative.fsti.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.Types_helpers.fsti.checked",
"Vale.AES.PPC64LE.PolyOps.fsti.checked",
"Vale.AES.GHash_BE.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.PPC64LE.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Vale.PPC64LE.Decls.va_get_ok",
"Prims.l_Forall",
"Vale.PPC64LE.Machine_s.nat64",
"Vale.PPC64LE.Machine_s.quad32",
"Prims.l_imp",
"Prims.eq2",
"Vale.Math.Poly2_s.poly",
"Vale.Math.Poly2.Bits_s.of_quad32",
"Vale.PPC64LE.Decls.va_get_vec",
"Vale.AES.GF128.gf128_mul_rev",
"Vale.PPC64LE.Machine_s.state",
"Vale.PPC64LE.Decls.va_upd_vec",
"Vale.PPC64LE.Decls.va_upd_reg"
] | [] | module Vale.AES.PPC64LE.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Arch.TypesNative
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.InsBasic
open Vale.PPC64LE.InsMem
open Vale.PPC64LE.InsVector
open Vale.PPC64LE.QuickCode
open Vale.PPC64LE.QuickCodes
open Vale.AES.PPC64LE.PolyOps
open Vale.AES.Types_helpers
open Vale.AES.GHash_BE
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0)))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_v1:quad32) (va_x_v2:quad32) . let va_sM =
va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 va_s0) in va_get_ok va_sM /\ va_get_vec 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2;
va_Mod_vec 1]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2; va_Mod_vec 1]) (va_wp_ShiftLeft128_1 a)
(va_wpProof_ShiftLeft128_1 a))
//--
//-- High64ToLow
val va_code_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_High64ToLow : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_High64ToLow dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.div a
(Vale.Math.Poly2_s.monomial 64)) /\ va_state_eq va_sM (va_update_ok va_sM
(va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.div a (Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (())))
val va_wpProof_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> a:poly ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_High64ToLow dst src a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_High64ToLow dst src) ([va_mod_vec_opr
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode
unit (va_code_High64ToLow dst src)) =
(va_QProc (va_code_High64ToLow dst src) ([va_mod_vec_opr dst]) (va_wp_High64ToLow dst src a)
(va_wpProof_High64ToLow dst src a))
//--
//-- Low64ToHigh
val va_code_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_Low64ToHigh : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Low64ToHigh dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.mul
(Vale.Math.Poly2_s.mod a (Vale.Math.Poly2_s.monomial 64)) (Vale.Math.Poly2_s.monomial 64)) /\
va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_Low64ToHigh (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.mul (Vale.Math.Poly2_s.mod a (Vale.Math.Poly2_s.monomial 64))
(Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (())))
val va_wpProof_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> a:poly ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Low64ToHigh dst src a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Low64ToHigh dst src) ([va_mod_vec_opr
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_Low64ToHigh (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode
unit (va_code_Low64ToHigh dst src)) =
(va_QProc (va_code_Low64ToHigh dst src) ([va_mod_vec_opr dst]) (va_wp_Low64ToHigh dst src a)
(va_wpProof_Low64ToHigh dst src a))
//--
//-- ReduceMulRev128
val va_code_ReduceMulRev128 : va_dummy:unit -> Tot va_code
val va_codegen_success_ReduceMulRev128 : va_dummy:unit -> Tot va_pbool
val va_lemma_ReduceMulRev128 : va_b0:va_code -> va_s0:va_state -> a:poly -> b:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ReduceMulRev128 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\ va_get_vec 2 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse
(Vale.AES.GF128_s.gf128_mul a b) 127) /\ va_state_eq va_sM (va_update_vec 6 va_sM
(va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM
(va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM
va_s0)))))))))))
[@ va_qattr]
let va_wp_ReduceMulRev128 (a:poly) (b:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) :
Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\
va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\
va_get_vec 2 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127) /\
(forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32)
(va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) . let va_sM = va_upd_vec 6 va_x_v6
(va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2
(va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0))))))) in va_get_ok
va_sM /\ va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse
(Vale.AES.GF128_s.gf128_mul a b) 127) ==> va_k va_sM (())))
val va_wpProof_ReduceMulRev128 : a:poly -> b:poly -> va_s0:va_state -> va_k:(va_state -> unit ->
Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ReduceMulRev128 a b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ReduceMulRev128 ()) ([va_Mod_vec 6;
va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg
10]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ReduceMulRev128 (a:poly) (b:poly) : (va_quickCode unit (va_code_ReduceMulRev128 ())) =
(va_QProc (va_code_ReduceMulRev128 ()) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3;
va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_ReduceMulRev128 a b)
(va_wpProof_ReduceMulRev128 a b))
//--
//-- Gf128MulRev128
val va_code_Gf128MulRev128 : va_dummy:unit -> Tot va_code
val va_codegen_success_Gf128MulRev128 : va_dummy:unit -> Tot va_pbool
val va_lemma_Gf128MulRev128 : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Gf128MulRev128 ()) va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1 va_s0) in let
(b:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 2 va_s0) in
Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1 va_sM) == Vale.AES.GF128.gf128_mul_rev a b) /\
va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM
(va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM
(va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))))))))
[@ va_qattr] | false | true | Vale.AES.PPC64LE.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wp_Gf128MulRev128 (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [] | Vale.AES.PPC64LE.GF128_Mul.va_wp_Gf128MulRev128 | {
"file_name": "obj/Vale.AES.PPC64LE.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
va_s0: Vale.PPC64LE.Decls.va_state ->
va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | {
"end_col": 30,
"end_line": 203,
"start_col": 2,
"start_line": 196
} |
Prims.Tot | val va_wp_ReduceMulRev128 (a b: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wp_ReduceMulRev128 (a:poly) (b:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) :
Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\
va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\
va_get_vec 2 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127) /\
(forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32)
(va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) . let va_sM = va_upd_vec 6 va_x_v6
(va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2
(va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0))))))) in va_get_ok
va_sM /\ va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse
(Vale.AES.GF128_s.gf128_mul a b) 127) ==> va_k va_sM (()))) | val va_wp_ReduceMulRev128 (a b: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0
let va_wp_ReduceMulRev128 (a b: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 = | false | null | false | (va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\
va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\
va_get_vec 2 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127) /\
(forall (va_x_r10: nat64)
(va_x_v0: quad32)
(va_x_v1: quad32)
(va_x_v2: quad32)
(va_x_v3: quad32)
(va_x_v4: quad32)
(va_x_v5: quad32)
(va_x_v6: quad32).
let va_sM =
va_upd_vec 6
va_x_v6
(va_upd_vec 5
va_x_v5
(va_upd_vec 4
va_x_v4
(va_upd_vec 3
va_x_v3
(va_upd_vec 2
va_x_v2
(va_upd_vec 1
va_x_v1
(va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0)))))))
in
va_get_ok va_sM /\
va_get_vec 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse (Vale.AES.GF128_s.gf128_mul a b)
127) ==>
va_k va_sM (()))) | {
"checked_file": "Vale.AES.PPC64LE.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCodes.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsVector.fsti.checked",
"Vale.PPC64LE.InsMem.fsti.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.TypesNative.fsti.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.Types_helpers.fsti.checked",
"Vale.AES.PPC64LE.PolyOps.fsti.checked",
"Vale.AES.GHash_BE.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.PPC64LE.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.Math.Poly2_s.poly",
"Vale.PPC64LE.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Prims.b2t",
"Vale.PPC64LE.Decls.va_get_ok",
"Prims.op_LessThanOrEqual",
"Vale.Math.Poly2_s.degree",
"Prims.eq2",
"Vale.Def.Types_s.quad32",
"Vale.PPC64LE.Decls.va_get_vec",
"Vale.Math.Poly2.Bits_s.to_quad32",
"Vale.Math.Poly2_s.reverse",
"Prims.l_Forall",
"Vale.PPC64LE.Machine_s.nat64",
"Vale.PPC64LE.Machine_s.quad32",
"Prims.l_imp",
"Vale.AES.GF128_s.gf128_mul",
"Vale.PPC64LE.Machine_s.state",
"Vale.PPC64LE.Decls.va_upd_vec",
"Vale.PPC64LE.Decls.va_upd_reg"
] | [] | module Vale.AES.PPC64LE.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Arch.TypesNative
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.InsBasic
open Vale.PPC64LE.InsMem
open Vale.PPC64LE.InsVector
open Vale.PPC64LE.QuickCode
open Vale.PPC64LE.QuickCodes
open Vale.AES.PPC64LE.PolyOps
open Vale.AES.Types_helpers
open Vale.AES.GHash_BE
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0)))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_v1:quad32) (va_x_v2:quad32) . let va_sM =
va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 va_s0) in va_get_ok va_sM /\ va_get_vec 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2;
va_Mod_vec 1]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2; va_Mod_vec 1]) (va_wp_ShiftLeft128_1 a)
(va_wpProof_ShiftLeft128_1 a))
//--
//-- High64ToLow
val va_code_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_High64ToLow : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_High64ToLow dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.div a
(Vale.Math.Poly2_s.monomial 64)) /\ va_state_eq va_sM (va_update_ok va_sM
(va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.div a (Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (())))
val va_wpProof_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> a:poly ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_High64ToLow dst src a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_High64ToLow dst src) ([va_mod_vec_opr
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode
unit (va_code_High64ToLow dst src)) =
(va_QProc (va_code_High64ToLow dst src) ([va_mod_vec_opr dst]) (va_wp_High64ToLow dst src a)
(va_wpProof_High64ToLow dst src a))
//--
//-- Low64ToHigh
val va_code_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_Low64ToHigh : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Low64ToHigh dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.mul
(Vale.Math.Poly2_s.mod a (Vale.Math.Poly2_s.monomial 64)) (Vale.Math.Poly2_s.monomial 64)) /\
va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_Low64ToHigh (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.mul (Vale.Math.Poly2_s.mod a (Vale.Math.Poly2_s.monomial 64))
(Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (())))
val va_wpProof_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> a:poly ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Low64ToHigh dst src a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Low64ToHigh dst src) ([va_mod_vec_opr
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_Low64ToHigh (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode
unit (va_code_Low64ToHigh dst src)) =
(va_QProc (va_code_Low64ToHigh dst src) ([va_mod_vec_opr dst]) (va_wp_Low64ToHigh dst src a)
(va_wpProof_Low64ToHigh dst src a))
//--
//-- ReduceMulRev128
val va_code_ReduceMulRev128 : va_dummy:unit -> Tot va_code
val va_codegen_success_ReduceMulRev128 : va_dummy:unit -> Tot va_pbool
val va_lemma_ReduceMulRev128 : va_b0:va_code -> va_s0:va_state -> a:poly -> b:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ReduceMulRev128 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\ va_get_vec 2 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse
(Vale.AES.GF128_s.gf128_mul a b) 127) /\ va_state_eq va_sM (va_update_vec 6 va_sM
(va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM
(va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM
va_s0)))))))))))
[@ va_qattr]
let va_wp_ReduceMulRev128 (a:poly) (b:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : | false | true | Vale.AES.PPC64LE.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wp_ReduceMulRev128 (a b: poly) (va_s0: va_state) (va_k: (va_state -> unit -> Type0)) : Type0 | [] | Vale.AES.PPC64LE.GF128_Mul.va_wp_ReduceMulRev128 | {
"file_name": "obj/Vale.AES.PPC64LE.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
a: Vale.Math.Poly2_s.poly ->
b: Vale.Math.Poly2_s.poly ->
va_s0: Vale.PPC64LE.Decls.va_state ->
va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | {
"end_col": 63,
"end_line": 163,
"start_col": 2,
"start_line": 155
} |
Prims.Tot | val va_wp_Low64ToHigh
(dst src: va_operand_vec_opr)
(a: poly)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | [
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_wp_Low64ToHigh (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.mul (Vale.Math.Poly2_s.mod a (Vale.Math.Poly2_s.monomial 64))
(Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (()))) | val va_wp_Low64ToHigh
(dst src: va_operand_vec_opr)
(a: poly)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0
let va_wp_Low64ToHigh
(dst src: va_operand_vec_opr)
(a: poly)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 = | false | null | false | (va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\
va_get_vec 0 va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\
Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\
(forall (va_x_dst: va_value_vec_opr).
let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\
va_eval_vec_opr va_sM dst ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.mul (Vale.Math.Poly2_s.mod a
(Vale.Math.Poly2_s.monomial 64))
(Vale.Math.Poly2_s.monomial 64)) ==>
va_k va_sM (()))) | {
"checked_file": "Vale.AES.PPC64LE.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCodes.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsVector.fsti.checked",
"Vale.PPC64LE.InsMem.fsti.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.TypesNative.fsti.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.Types_helpers.fsti.checked",
"Vale.AES.PPC64LE.PolyOps.fsti.checked",
"Vale.AES.GHash_BE.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.PPC64LE.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Decls.va_operand_vec_opr",
"Vale.Math.Poly2_s.poly",
"Vale.PPC64LE.Decls.va_state",
"Prims.unit",
"Prims.l_and",
"Vale.PPC64LE.Decls.va_is_dst_vec_opr",
"Vale.PPC64LE.Decls.va_is_src_vec_opr",
"Prims.b2t",
"Vale.PPC64LE.Decls.va_get_ok",
"Prims.eq2",
"Vale.Def.Words_s.four",
"Vale.Def.Types_s.nat32",
"Vale.PPC64LE.Decls.va_get_vec",
"Vale.Def.Words_s.Mkfour",
"Prims.op_LessThanOrEqual",
"Vale.Math.Poly2_s.degree",
"Vale.Def.Types_s.quad32",
"Vale.PPC64LE.Decls.va_eval_vec_opr",
"Vale.Math.Poly2.Bits_s.to_quad32",
"Prims.l_Forall",
"Vale.PPC64LE.Decls.va_value_vec_opr",
"Prims.l_imp",
"Vale.Math.Poly2_s.mul",
"Vale.Math.Poly2_s.mod",
"Vale.Math.Poly2_s.monomial",
"Vale.PPC64LE.Machine_s.state",
"Vale.PPC64LE.Decls.va_upd_operand_vec_opr"
] | [] | module Vale.AES.PPC64LE.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Arch.TypesNative
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.InsBasic
open Vale.PPC64LE.InsMem
open Vale.PPC64LE.InsVector
open Vale.PPC64LE.QuickCode
open Vale.PPC64LE.QuickCodes
open Vale.AES.PPC64LE.PolyOps
open Vale.AES.Types_helpers
open Vale.AES.GHash_BE
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0)))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_v1:quad32) (va_x_v2:quad32) . let va_sM =
va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 va_s0) in va_get_ok va_sM /\ va_get_vec 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2;
va_Mod_vec 1]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2; va_Mod_vec 1]) (va_wp_ShiftLeft128_1 a)
(va_wpProof_ShiftLeft128_1 a))
//--
//-- High64ToLow
val va_code_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_High64ToLow : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_High64ToLow dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.div a
(Vale.Math.Poly2_s.monomial 64)) /\ va_state_eq va_sM (va_update_ok va_sM
(va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.div a (Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (())))
val va_wpProof_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> a:poly ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_High64ToLow dst src a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_High64ToLow dst src) ([va_mod_vec_opr
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode
unit (va_code_High64ToLow dst src)) =
(va_QProc (va_code_High64ToLow dst src) ([va_mod_vec_opr dst]) (va_wp_High64ToLow dst src a)
(va_wpProof_High64ToLow dst src a))
//--
//-- Low64ToHigh
val va_code_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_Low64ToHigh : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Low64ToHigh dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.mul
(Vale.Math.Poly2_s.mod a (Vale.Math.Poly2_s.monomial 64)) (Vale.Math.Poly2_s.monomial 64)) /\
va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_Low64ToHigh (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state) | false | true | Vale.AES.PPC64LE.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_wp_Low64ToHigh
(dst src: va_operand_vec_opr)
(a: poly)
(va_s0: va_state)
(va_k: (va_state -> unit -> Type0))
: Type0 | [] | Vale.AES.PPC64LE.GF128_Mul.va_wp_Low64ToHigh | {
"file_name": "obj/Vale.AES.PPC64LE.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.PPC64LE.Decls.va_operand_vec_opr ->
src: Vale.PPC64LE.Decls.va_operand_vec_opr ->
a: Vale.Math.Poly2_s.poly ->
va_s0: Vale.PPC64LE.Decls.va_state ->
va_k: (_: Vale.PPC64LE.Decls.va_state -> _: Prims.unit -> Type0)
-> Type0 | {
"end_col": 58,
"end_line": 120,
"start_col": 2,
"start_line": 114
} |
Prims.Tot | val va_quick_ShiftLeft128_1 (a: poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) | [
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2; va_Mod_vec 1]) (va_wp_ShiftLeft128_1 a)
(va_wpProof_ShiftLeft128_1 a)) | val va_quick_ShiftLeft128_1 (a: poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ()))
let va_quick_ShiftLeft128_1 (a: poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) = | false | null | false | (va_QProc (va_code_ShiftLeft128_1 ())
([va_Mod_vec 2; va_Mod_vec 1])
(va_wp_ShiftLeft128_1 a)
(va_wpProof_ShiftLeft128_1 a)) | {
"checked_file": "Vale.AES.PPC64LE.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCodes.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsVector.fsti.checked",
"Vale.PPC64LE.InsMem.fsti.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.TypesNative.fsti.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.Types_helpers.fsti.checked",
"Vale.AES.PPC64LE.PolyOps.fsti.checked",
"Vale.AES.GHash_BE.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.PPC64LE.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.Math.Poly2_s.poly",
"Vale.PPC64LE.QuickCode.va_QProc",
"Prims.unit",
"Vale.AES.PPC64LE.GF128_Mul.va_code_ShiftLeft128_1",
"Prims.Cons",
"Vale.PPC64LE.QuickCode.mod_t",
"Vale.PPC64LE.QuickCode.va_Mod_vec",
"Prims.Nil",
"Vale.AES.PPC64LE.GF128_Mul.va_wp_ShiftLeft128_1",
"Vale.AES.PPC64LE.GF128_Mul.va_wpProof_ShiftLeft128_1",
"Vale.PPC64LE.QuickCode.va_quickCode"
] | [] | module Vale.AES.PPC64LE.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Arch.TypesNative
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.InsBasic
open Vale.PPC64LE.InsMem
open Vale.PPC64LE.InsVector
open Vale.PPC64LE.QuickCode
open Vale.PPC64LE.QuickCodes
open Vale.AES.PPC64LE.PolyOps
open Vale.AES.Types_helpers
open Vale.AES.GHash_BE
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0)))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_v1:quad32) (va_x_v2:quad32) . let va_sM =
va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 va_s0) in va_get_ok va_sM /\ va_get_vec 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2;
va_Mod_vec 1]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr] | false | false | Vale.AES.PPC64LE.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_quick_ShiftLeft128_1 (a: poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) | [] | Vale.AES.PPC64LE.GF128_Mul.va_quick_ShiftLeft128_1 | {
"file_name": "obj/Vale.AES.PPC64LE.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Vale.Math.Poly2_s.poly
-> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit
(Vale.AES.PPC64LE.GF128_Mul.va_code_ShiftLeft128_1 ()) | {
"end_col": 34,
"end_line": 51,
"start_col": 2,
"start_line": 50
} |
Prims.Tot | val va_quick_High64ToLow (dst src: va_operand_vec_opr) (a: poly)
: (va_quickCode unit (va_code_High64ToLow dst src)) | [
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_quick_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode
unit (va_code_High64ToLow dst src)) =
(va_QProc (va_code_High64ToLow dst src) ([va_mod_vec_opr dst]) (va_wp_High64ToLow dst src a)
(va_wpProof_High64ToLow dst src a)) | val va_quick_High64ToLow (dst src: va_operand_vec_opr) (a: poly)
: (va_quickCode unit (va_code_High64ToLow dst src))
let va_quick_High64ToLow (dst src: va_operand_vec_opr) (a: poly)
: (va_quickCode unit (va_code_High64ToLow dst src)) = | false | null | false | (va_QProc (va_code_High64ToLow dst src)
([va_mod_vec_opr dst])
(va_wp_High64ToLow dst src a)
(va_wpProof_High64ToLow dst src a)) | {
"checked_file": "Vale.AES.PPC64LE.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCodes.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsVector.fsti.checked",
"Vale.PPC64LE.InsMem.fsti.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.TypesNative.fsti.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.Types_helpers.fsti.checked",
"Vale.AES.PPC64LE.PolyOps.fsti.checked",
"Vale.AES.GHash_BE.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.PPC64LE.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Decls.va_operand_vec_opr",
"Vale.Math.Poly2_s.poly",
"Vale.PPC64LE.QuickCode.va_QProc",
"Prims.unit",
"Vale.AES.PPC64LE.GF128_Mul.va_code_High64ToLow",
"Prims.Cons",
"Vale.PPC64LE.QuickCode.mod_t",
"Vale.PPC64LE.QuickCode.va_mod_vec_opr",
"Prims.Nil",
"Vale.AES.PPC64LE.GF128_Mul.va_wp_High64ToLow",
"Vale.AES.PPC64LE.GF128_Mul.va_wpProof_High64ToLow",
"Vale.PPC64LE.QuickCode.va_quickCode"
] | [] | module Vale.AES.PPC64LE.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Arch.TypesNative
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.InsBasic
open Vale.PPC64LE.InsMem
open Vale.PPC64LE.InsVector
open Vale.PPC64LE.QuickCode
open Vale.PPC64LE.QuickCodes
open Vale.AES.PPC64LE.PolyOps
open Vale.AES.Types_helpers
open Vale.AES.GHash_BE
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0)))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_v1:quad32) (va_x_v2:quad32) . let va_sM =
va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 va_s0) in va_get_ok va_sM /\ va_get_vec 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2;
va_Mod_vec 1]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2; va_Mod_vec 1]) (va_wp_ShiftLeft128_1 a)
(va_wpProof_ShiftLeft128_1 a))
//--
//-- High64ToLow
val va_code_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_High64ToLow : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_High64ToLow dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.div a
(Vale.Math.Poly2_s.monomial 64)) /\ va_state_eq va_sM (va_update_ok va_sM
(va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.div a (Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (())))
val va_wpProof_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> a:poly ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_High64ToLow dst src a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_High64ToLow dst src) ([va_mod_vec_opr
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode | false | false | Vale.AES.PPC64LE.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_quick_High64ToLow (dst src: va_operand_vec_opr) (a: poly)
: (va_quickCode unit (va_code_High64ToLow dst src)) | [] | Vale.AES.PPC64LE.GF128_Mul.va_quick_High64ToLow | {
"file_name": "obj/Vale.AES.PPC64LE.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.PPC64LE.Decls.va_operand_vec_opr ->
src: Vale.PPC64LE.Decls.va_operand_vec_opr ->
a: Vale.Math.Poly2_s.poly
-> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit
(Vale.AES.PPC64LE.GF128_Mul.va_code_High64ToLow dst src) | {
"end_col": 39,
"end_line": 91,
"start_col": 2,
"start_line": 90
} |
Prims.Tot | val va_quick_Gf128MulRev128: Prims.unit -> (va_quickCode unit (va_code_Gf128MulRev128 ())) | [
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_quick_Gf128MulRev128 () : (va_quickCode unit (va_code_Gf128MulRev128 ())) =
(va_QProc (va_code_Gf128MulRev128 ()) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3;
va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) va_wp_Gf128MulRev128
va_wpProof_Gf128MulRev128) | val va_quick_Gf128MulRev128: Prims.unit -> (va_quickCode unit (va_code_Gf128MulRev128 ()))
let va_quick_Gf128MulRev128 () : (va_quickCode unit (va_code_Gf128MulRev128 ())) = | false | null | false | (va_QProc (va_code_Gf128MulRev128 ())
([
va_Mod_vec 6;
va_Mod_vec 5;
va_Mod_vec 4;
va_Mod_vec 3;
va_Mod_vec 2;
va_Mod_vec 1;
va_Mod_vec 0;
va_Mod_reg 10
])
va_wp_Gf128MulRev128
va_wpProof_Gf128MulRev128) | {
"checked_file": "Vale.AES.PPC64LE.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCodes.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsVector.fsti.checked",
"Vale.PPC64LE.InsMem.fsti.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.TypesNative.fsti.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.Types_helpers.fsti.checked",
"Vale.AES.PPC64LE.PolyOps.fsti.checked",
"Vale.AES.GHash_BE.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.PPC64LE.GF128_Mul.fsti"
} | [
"total"
] | [
"Prims.unit",
"Vale.PPC64LE.QuickCode.va_QProc",
"Vale.AES.PPC64LE.GF128_Mul.va_code_Gf128MulRev128",
"Prims.Cons",
"Vale.PPC64LE.QuickCode.mod_t",
"Vale.PPC64LE.QuickCode.va_Mod_vec",
"Vale.PPC64LE.QuickCode.va_Mod_reg",
"Prims.Nil",
"Vale.AES.PPC64LE.GF128_Mul.va_wp_Gf128MulRev128",
"Vale.AES.PPC64LE.GF128_Mul.va_wpProof_Gf128MulRev128",
"Vale.PPC64LE.QuickCode.va_quickCode"
] | [] | module Vale.AES.PPC64LE.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Arch.TypesNative
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.InsBasic
open Vale.PPC64LE.InsMem
open Vale.PPC64LE.InsVector
open Vale.PPC64LE.QuickCode
open Vale.PPC64LE.QuickCodes
open Vale.AES.PPC64LE.PolyOps
open Vale.AES.Types_helpers
open Vale.AES.GHash_BE
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0)))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_v1:quad32) (va_x_v2:quad32) . let va_sM =
va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 va_s0) in va_get_ok va_sM /\ va_get_vec 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2;
va_Mod_vec 1]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2; va_Mod_vec 1]) (va_wp_ShiftLeft128_1 a)
(va_wpProof_ShiftLeft128_1 a))
//--
//-- High64ToLow
val va_code_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_High64ToLow : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_High64ToLow dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.div a
(Vale.Math.Poly2_s.monomial 64)) /\ va_state_eq va_sM (va_update_ok va_sM
(va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.div a (Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (())))
val va_wpProof_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> a:poly ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_High64ToLow dst src a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_High64ToLow dst src) ([va_mod_vec_opr
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode
unit (va_code_High64ToLow dst src)) =
(va_QProc (va_code_High64ToLow dst src) ([va_mod_vec_opr dst]) (va_wp_High64ToLow dst src a)
(va_wpProof_High64ToLow dst src a))
//--
//-- Low64ToHigh
val va_code_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_Low64ToHigh : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Low64ToHigh dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.mul
(Vale.Math.Poly2_s.mod a (Vale.Math.Poly2_s.monomial 64)) (Vale.Math.Poly2_s.monomial 64)) /\
va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_Low64ToHigh (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.mul (Vale.Math.Poly2_s.mod a (Vale.Math.Poly2_s.monomial 64))
(Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (())))
val va_wpProof_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> a:poly ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Low64ToHigh dst src a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Low64ToHigh dst src) ([va_mod_vec_opr
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_Low64ToHigh (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode
unit (va_code_Low64ToHigh dst src)) =
(va_QProc (va_code_Low64ToHigh dst src) ([va_mod_vec_opr dst]) (va_wp_Low64ToHigh dst src a)
(va_wpProof_Low64ToHigh dst src a))
//--
//-- ReduceMulRev128
val va_code_ReduceMulRev128 : va_dummy:unit -> Tot va_code
val va_codegen_success_ReduceMulRev128 : va_dummy:unit -> Tot va_pbool
val va_lemma_ReduceMulRev128 : va_b0:va_code -> va_s0:va_state -> a:poly -> b:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ReduceMulRev128 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\ va_get_vec 2 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse
(Vale.AES.GF128_s.gf128_mul a b) 127) /\ va_state_eq va_sM (va_update_vec 6 va_sM
(va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM
(va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM
va_s0)))))))))))
[@ va_qattr]
let va_wp_ReduceMulRev128 (a:poly) (b:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) :
Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\
va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\
va_get_vec 2 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127) /\
(forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32)
(va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) . let va_sM = va_upd_vec 6 va_x_v6
(va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2
(va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0))))))) in va_get_ok
va_sM /\ va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse
(Vale.AES.GF128_s.gf128_mul a b) 127) ==> va_k va_sM (())))
val va_wpProof_ReduceMulRev128 : a:poly -> b:poly -> va_s0:va_state -> va_k:(va_state -> unit ->
Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ReduceMulRev128 a b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ReduceMulRev128 ()) ([va_Mod_vec 6;
va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg
10]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ReduceMulRev128 (a:poly) (b:poly) : (va_quickCode unit (va_code_ReduceMulRev128 ())) =
(va_QProc (va_code_ReduceMulRev128 ()) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3;
va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_ReduceMulRev128 a b)
(va_wpProof_ReduceMulRev128 a b))
//--
//-- Gf128MulRev128
val va_code_Gf128MulRev128 : va_dummy:unit -> Tot va_code
val va_codegen_success_Gf128MulRev128 : va_dummy:unit -> Tot va_pbool
val va_lemma_Gf128MulRev128 : va_b0:va_code -> va_s0:va_state
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Gf128MulRev128 ()) va_s0 /\ va_get_ok va_s0))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
(let (a:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1 va_s0) in let
(b:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 2 va_s0) in
Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1 va_sM) == Vale.AES.GF128.gf128_mul_rev a b) /\
va_state_eq va_sM (va_update_vec 6 va_sM (va_update_vec 5 va_sM (va_update_vec 4 va_sM
(va_update_vec 3 va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_vec 0 va_sM
(va_update_reg 10 va_sM (va_update_ok va_sM va_s0)))))))))))
[@ va_qattr]
let va_wp_Gf128MulRev128 (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ (forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32)
(va_x_v3:quad32) (va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) . let va_sM = va_upd_vec 6
va_x_v6 (va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2
(va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0))))))) in va_get_ok
va_sM /\ (let (a:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1
va_s0) in let (b:Vale.Math.Poly2_s.poly) = Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 2
va_s0) in Vale.Math.Poly2.Bits_s.of_quad32 (va_get_vec 1 va_sM) == Vale.AES.GF128.gf128_mul_rev
a b) ==> va_k va_sM (())))
val va_wpProof_Gf128MulRev128 : va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Gf128MulRev128 va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Gf128MulRev128 ()) ([va_Mod_vec 6;
va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg
10]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr] | false | false | Vale.AES.PPC64LE.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_quick_Gf128MulRev128: Prims.unit -> (va_quickCode unit (va_code_Gf128MulRev128 ())) | [] | Vale.AES.PPC64LE.GF128_Mul.va_quick_Gf128MulRev128 | {
"file_name": "obj/Vale.AES.PPC64LE.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | _: Prims.unit
-> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit
(Vale.AES.PPC64LE.GF128_Mul.va_code_Gf128MulRev128 ()) | {
"end_col": 30,
"end_line": 215,
"start_col": 2,
"start_line": 213
} |
Prims.Tot | val va_quick_Low64ToHigh (dst src: va_operand_vec_opr) (a: poly)
: (va_quickCode unit (va_code_Low64ToHigh dst src)) | [
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_quick_Low64ToHigh (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode
unit (va_code_Low64ToHigh dst src)) =
(va_QProc (va_code_Low64ToHigh dst src) ([va_mod_vec_opr dst]) (va_wp_Low64ToHigh dst src a)
(va_wpProof_Low64ToHigh dst src a)) | val va_quick_Low64ToHigh (dst src: va_operand_vec_opr) (a: poly)
: (va_quickCode unit (va_code_Low64ToHigh dst src))
let va_quick_Low64ToHigh (dst src: va_operand_vec_opr) (a: poly)
: (va_quickCode unit (va_code_Low64ToHigh dst src)) = | false | null | false | (va_QProc (va_code_Low64ToHigh dst src)
([va_mod_vec_opr dst])
(va_wp_Low64ToHigh dst src a)
(va_wpProof_Low64ToHigh dst src a)) | {
"checked_file": "Vale.AES.PPC64LE.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCodes.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsVector.fsti.checked",
"Vale.PPC64LE.InsMem.fsti.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.TypesNative.fsti.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.Types_helpers.fsti.checked",
"Vale.AES.PPC64LE.PolyOps.fsti.checked",
"Vale.AES.GHash_BE.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.PPC64LE.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.PPC64LE.Decls.va_operand_vec_opr",
"Vale.Math.Poly2_s.poly",
"Vale.PPC64LE.QuickCode.va_QProc",
"Prims.unit",
"Vale.AES.PPC64LE.GF128_Mul.va_code_Low64ToHigh",
"Prims.Cons",
"Vale.PPC64LE.QuickCode.mod_t",
"Vale.PPC64LE.QuickCode.va_mod_vec_opr",
"Prims.Nil",
"Vale.AES.PPC64LE.GF128_Mul.va_wp_Low64ToHigh",
"Vale.AES.PPC64LE.GF128_Mul.va_wpProof_Low64ToHigh",
"Vale.PPC64LE.QuickCode.va_quickCode"
] | [] | module Vale.AES.PPC64LE.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Arch.TypesNative
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.InsBasic
open Vale.PPC64LE.InsMem
open Vale.PPC64LE.InsVector
open Vale.PPC64LE.QuickCode
open Vale.PPC64LE.QuickCodes
open Vale.AES.PPC64LE.PolyOps
open Vale.AES.Types_helpers
open Vale.AES.GHash_BE
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0)))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_v1:quad32) (va_x_v2:quad32) . let va_sM =
va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 va_s0) in va_get_ok va_sM /\ va_get_vec 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2;
va_Mod_vec 1]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2; va_Mod_vec 1]) (va_wp_ShiftLeft128_1 a)
(va_wpProof_ShiftLeft128_1 a))
//--
//-- High64ToLow
val va_code_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_High64ToLow : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_High64ToLow dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.div a
(Vale.Math.Poly2_s.monomial 64)) /\ va_state_eq va_sM (va_update_ok va_sM
(va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.div a (Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (())))
val va_wpProof_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> a:poly ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_High64ToLow dst src a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_High64ToLow dst src) ([va_mod_vec_opr
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode
unit (va_code_High64ToLow dst src)) =
(va_QProc (va_code_High64ToLow dst src) ([va_mod_vec_opr dst]) (va_wp_High64ToLow dst src a)
(va_wpProof_High64ToLow dst src a))
//--
//-- Low64ToHigh
val va_code_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_Low64ToHigh : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Low64ToHigh dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.mul
(Vale.Math.Poly2_s.mod a (Vale.Math.Poly2_s.monomial 64)) (Vale.Math.Poly2_s.monomial 64)) /\
va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_Low64ToHigh (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.mul (Vale.Math.Poly2_s.mod a (Vale.Math.Poly2_s.monomial 64))
(Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (())))
val va_wpProof_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> a:poly ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Low64ToHigh dst src a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Low64ToHigh dst src) ([va_mod_vec_opr
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_Low64ToHigh (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode | false | false | Vale.AES.PPC64LE.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_quick_Low64ToHigh (dst src: va_operand_vec_opr) (a: poly)
: (va_quickCode unit (va_code_Low64ToHigh dst src)) | [] | Vale.AES.PPC64LE.GF128_Mul.va_quick_Low64ToHigh | {
"file_name": "obj/Vale.AES.PPC64LE.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} |
dst: Vale.PPC64LE.Decls.va_operand_vec_opr ->
src: Vale.PPC64LE.Decls.va_operand_vec_opr ->
a: Vale.Math.Poly2_s.poly
-> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit
(Vale.AES.PPC64LE.GF128_Mul.va_code_Low64ToHigh dst src) | {
"end_col": 39,
"end_line": 132,
"start_col": 2,
"start_line": 131
} |
Prims.Tot | val va_quick_ReduceMulRev128 (a b: poly) : (va_quickCode unit (va_code_ReduceMulRev128 ())) | [
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GHash_BE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.Types_helpers",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE.PolyOps",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCodes",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.QuickCode",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsVector",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsMem",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.InsBasic",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Decls",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.State",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.PPC64LE.Machine_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.GF128_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Lemmas",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2.Bits_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Math.Poly2_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.TypesNative",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Arch.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.Def.Types_s",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "Vale.AES.PPC64LE",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let va_quick_ReduceMulRev128 (a:poly) (b:poly) : (va_quickCode unit (va_code_ReduceMulRev128 ())) =
(va_QProc (va_code_ReduceMulRev128 ()) ([va_Mod_vec 6; va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3;
va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg 10]) (va_wp_ReduceMulRev128 a b)
(va_wpProof_ReduceMulRev128 a b)) | val va_quick_ReduceMulRev128 (a b: poly) : (va_quickCode unit (va_code_ReduceMulRev128 ()))
let va_quick_ReduceMulRev128 (a b: poly) : (va_quickCode unit (va_code_ReduceMulRev128 ())) = | false | null | false | (va_QProc (va_code_ReduceMulRev128 ())
([
va_Mod_vec 6;
va_Mod_vec 5;
va_Mod_vec 4;
va_Mod_vec 3;
va_Mod_vec 2;
va_Mod_vec 1;
va_Mod_vec 0;
va_Mod_reg 10
])
(va_wp_ReduceMulRev128 a b)
(va_wpProof_ReduceMulRev128 a b)) | {
"checked_file": "Vale.AES.PPC64LE.GF128_Mul.fsti.checked",
"dependencies": [
"Vale.PPC64LE.State.fsti.checked",
"Vale.PPC64LE.QuickCodes.fsti.checked",
"Vale.PPC64LE.QuickCode.fst.checked",
"Vale.PPC64LE.Machine_s.fst.checked",
"Vale.PPC64LE.InsVector.fsti.checked",
"Vale.PPC64LE.InsMem.fsti.checked",
"Vale.PPC64LE.InsBasic.fsti.checked",
"Vale.PPC64LE.Decls.fsti.checked",
"Vale.Math.Poly2_s.fsti.checked",
"Vale.Math.Poly2.Lemmas.fsti.checked",
"Vale.Math.Poly2.Bits_s.fsti.checked",
"Vale.Math.Poly2.Bits.fsti.checked",
"Vale.Math.Poly2.fsti.checked",
"Vale.Def.Words_s.fsti.checked",
"Vale.Def.Types_s.fst.checked",
"Vale.Arch.TypesNative.fsti.checked",
"Vale.Arch.Types.fsti.checked",
"Vale.AES.Types_helpers.fsti.checked",
"Vale.AES.PPC64LE.PolyOps.fsti.checked",
"Vale.AES.GHash_BE.fsti.checked",
"Vale.AES.GF128_s.fsti.checked",
"Vale.AES.GF128.fsti.checked",
"prims.fst.checked",
"FStar.Pervasives.Native.fst.checked",
"FStar.Pervasives.fsti.checked"
],
"interface_file": false,
"source_file": "Vale.AES.PPC64LE.GF128_Mul.fsti"
} | [
"total"
] | [
"Vale.Math.Poly2_s.poly",
"Vale.PPC64LE.QuickCode.va_QProc",
"Prims.unit",
"Vale.AES.PPC64LE.GF128_Mul.va_code_ReduceMulRev128",
"Prims.Cons",
"Vale.PPC64LE.QuickCode.mod_t",
"Vale.PPC64LE.QuickCode.va_Mod_vec",
"Vale.PPC64LE.QuickCode.va_Mod_reg",
"Prims.Nil",
"Vale.AES.PPC64LE.GF128_Mul.va_wp_ReduceMulRev128",
"Vale.AES.PPC64LE.GF128_Mul.va_wpProof_ReduceMulRev128",
"Vale.PPC64LE.QuickCode.va_quickCode"
] | [] | module Vale.AES.PPC64LE.GF128_Mul
open Vale.Def.Types_s
open Vale.Arch.Types
open Vale.Arch.TypesNative
open Vale.Math.Poly2_s
open Vale.Math.Poly2
open Vale.Math.Poly2.Bits_s
open Vale.Math.Poly2.Bits
open Vale.Math.Poly2.Lemmas
open Vale.AES.GF128_s
open Vale.AES.GF128
open Vale.PPC64LE.Machine_s
open Vale.PPC64LE.State
open Vale.PPC64LE.Decls
open Vale.PPC64LE.InsBasic
open Vale.PPC64LE.InsMem
open Vale.PPC64LE.InsVector
open Vale.PPC64LE.QuickCode
open Vale.PPC64LE.QuickCodes
open Vale.AES.PPC64LE.PolyOps
open Vale.AES.Types_helpers
open Vale.AES.GHash_BE
//-- ShiftLeft128_1
val va_code_ShiftLeft128_1 : va_dummy:unit -> Tot va_code
val va_codegen_success_ShiftLeft128_1 : va_dummy:unit -> Tot va_pbool
val va_lemma_ShiftLeft128_1 : va_b0:va_code -> va_s0:va_state -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ShiftLeft128_1 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) /\
va_state_eq va_sM (va_update_vec 2 va_sM (va_update_vec 1 va_sM (va_update_ok va_sM va_s0)))))
[@ va_qattr]
let va_wp_ShiftLeft128_1 (a:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) : Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a < 128 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall (va_x_v1:quad32) (va_x_v2:quad32) . let va_sM =
va_upd_vec 2 va_x_v2 (va_upd_vec 1 va_x_v1 va_s0) in va_get_ok va_sM /\ va_get_vec 1 va_sM ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.shift a 1) ==> va_k va_sM (())))
val va_wpProof_ShiftLeft128_1 : a:poly -> va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ShiftLeft128_1 a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2;
va_Mod_vec 1]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_ShiftLeft128_1 (a:poly) : (va_quickCode unit (va_code_ShiftLeft128_1 ())) =
(va_QProc (va_code_ShiftLeft128_1 ()) ([va_Mod_vec 2; va_Mod_vec 1]) (va_wp_ShiftLeft128_1 a)
(va_wpProof_ShiftLeft128_1 a))
//--
//-- High64ToLow
val va_code_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_High64ToLow : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_High64ToLow dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.div a
(Vale.Math.Poly2_s.monomial 64)) /\ va_state_eq va_sM (va_update_ok va_sM
(va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.div a (Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (())))
val va_wpProof_High64ToLow : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> a:poly ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_High64ToLow dst src a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_High64ToLow dst src) ([va_mod_vec_opr
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_High64ToLow (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode
unit (va_code_High64ToLow dst src)) =
(va_QProc (va_code_High64ToLow dst src) ([va_mod_vec_opr dst]) (va_wp_High64ToLow dst src a)
(va_wpProof_High64ToLow dst src a))
//--
//-- Low64ToHigh
val va_code_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot va_code
val va_codegen_success_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> Tot
va_pbool
val va_lemma_Low64ToHigh : va_b0:va_code -> va_s0:va_state -> dst:va_operand_vec_opr ->
src:va_operand_vec_opr -> a:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_Low64ToHigh dst src) va_s0 /\ va_is_dst_vec_opr dst
va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0 va_s0 ==
Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a <= 127 /\
va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.mul
(Vale.Math.Poly2_s.mod a (Vale.Math.Poly2_s.monomial 64)) (Vale.Math.Poly2_s.monomial 64)) /\
va_state_eq va_sM (va_update_ok va_sM (va_update_operand_vec_opr dst va_sM va_s0))))
[@ va_qattr]
let va_wp_Low64ToHigh (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) (va_s0:va_state)
(va_k:(va_state -> unit -> Type0)) : Type0 =
(va_is_dst_vec_opr dst va_s0 /\ va_is_src_vec_opr src va_s0 /\ va_get_ok va_s0 /\ va_get_vec 0
va_s0 == Vale.Def.Words_s.Mkfour #Vale.Def.Types_s.nat32 0 0 0 0 /\ Vale.Math.Poly2_s.degree a
<= 127 /\ va_eval_vec_opr va_s0 src == Vale.Math.Poly2.Bits_s.to_quad32 a /\ (forall
(va_x_dst:va_value_vec_opr) . let va_sM = va_upd_operand_vec_opr dst va_x_dst va_s0 in
va_get_ok va_sM /\ va_eval_vec_opr va_sM dst == Vale.Math.Poly2.Bits_s.to_quad32
(Vale.Math.Poly2_s.mul (Vale.Math.Poly2_s.mod a (Vale.Math.Poly2_s.monomial 64))
(Vale.Math.Poly2_s.monomial 64)) ==> va_k va_sM (())))
val va_wpProof_Low64ToHigh : dst:va_operand_vec_opr -> src:va_operand_vec_opr -> a:poly ->
va_s0:va_state -> va_k:(va_state -> unit -> Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_Low64ToHigh dst src a va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_Low64ToHigh dst src) ([va_mod_vec_opr
dst]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr]
let va_quick_Low64ToHigh (dst:va_operand_vec_opr) (src:va_operand_vec_opr) (a:poly) : (va_quickCode
unit (va_code_Low64ToHigh dst src)) =
(va_QProc (va_code_Low64ToHigh dst src) ([va_mod_vec_opr dst]) (va_wp_Low64ToHigh dst src a)
(va_wpProof_Low64ToHigh dst src a))
//--
//-- ReduceMulRev128
val va_code_ReduceMulRev128 : va_dummy:unit -> Tot va_code
val va_codegen_success_ReduceMulRev128 : va_dummy:unit -> Tot va_pbool
val va_lemma_ReduceMulRev128 : va_b0:va_code -> va_s0:va_state -> a:poly -> b:poly
-> Ghost (va_state & va_fuel)
(requires (va_require_total va_b0 (va_code_ReduceMulRev128 ()) va_s0 /\ va_get_ok va_s0 /\
Vale.Math.Poly2_s.degree a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\ va_get_vec 1 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\ va_get_vec 2 va_s0 ==
Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127)))
(ensures (fun (va_sM, va_fM) -> va_ensure_total va_b0 va_s0 va_sM va_fM /\ va_get_ok va_sM /\
va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse
(Vale.AES.GF128_s.gf128_mul a b) 127) /\ va_state_eq va_sM (va_update_vec 6 va_sM
(va_update_vec 5 va_sM (va_update_vec 4 va_sM (va_update_vec 3 va_sM (va_update_vec 2 va_sM
(va_update_vec 1 va_sM (va_update_vec 0 va_sM (va_update_reg 10 va_sM (va_update_ok va_sM
va_s0)))))))))))
[@ va_qattr]
let va_wp_ReduceMulRev128 (a:poly) (b:poly) (va_s0:va_state) (va_k:(va_state -> unit -> Type0)) :
Type0 =
(va_get_ok va_s0 /\ Vale.Math.Poly2_s.degree a <= 127 /\ Vale.Math.Poly2_s.degree b <= 127 /\
va_get_vec 1 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse a 127) /\
va_get_vec 2 va_s0 == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse b 127) /\
(forall (va_x_r10:nat64) (va_x_v0:quad32) (va_x_v1:quad32) (va_x_v2:quad32) (va_x_v3:quad32)
(va_x_v4:quad32) (va_x_v5:quad32) (va_x_v6:quad32) . let va_sM = va_upd_vec 6 va_x_v6
(va_upd_vec 5 va_x_v5 (va_upd_vec 4 va_x_v4 (va_upd_vec 3 va_x_v3 (va_upd_vec 2 va_x_v2
(va_upd_vec 1 va_x_v1 (va_upd_vec 0 va_x_v0 (va_upd_reg 10 va_x_r10 va_s0))))))) in va_get_ok
va_sM /\ va_get_vec 1 va_sM == Vale.Math.Poly2.Bits_s.to_quad32 (Vale.Math.Poly2_s.reverse
(Vale.AES.GF128_s.gf128_mul a b) 127) ==> va_k va_sM (())))
val va_wpProof_ReduceMulRev128 : a:poly -> b:poly -> va_s0:va_state -> va_k:(va_state -> unit ->
Type0)
-> Ghost (va_state & va_fuel & unit)
(requires (va_t_require va_s0 /\ va_wp_ReduceMulRev128 a b va_s0 va_k))
(ensures (fun (va_sM, va_f0, va_g) -> va_t_ensure (va_code_ReduceMulRev128 ()) ([va_Mod_vec 6;
va_Mod_vec 5; va_Mod_vec 4; va_Mod_vec 3; va_Mod_vec 2; va_Mod_vec 1; va_Mod_vec 0; va_Mod_reg
10]) va_s0 va_k ((va_sM, va_f0, va_g))))
[@ "opaque_to_smt" va_qattr] | false | false | Vale.AES.PPC64LE.GF128_Mul.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 0,
"max_fuel": 1,
"max_ifuel": 1,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": true,
"smtencoding_l_arith_repr": "native",
"smtencoding_nl_arith_repr": "wrapped",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": false,
"z3cliopt": [
"smt.arith.nl=false",
"smt.QI.EAGER_THRESHOLD=100",
"smt.CASE_SPLIT=3"
],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val va_quick_ReduceMulRev128 (a b: poly) : (va_quickCode unit (va_code_ReduceMulRev128 ())) | [] | Vale.AES.PPC64LE.GF128_Mul.va_quick_ReduceMulRev128 | {
"file_name": "obj/Vale.AES.PPC64LE.GF128_Mul.fsti",
"git_rev": "12c5e9539c7e3c366c26409d3b86493548c4483e",
"git_url": "https://github.com/hacl-star/hacl-star.git",
"project_name": "hacl-star"
} | a: Vale.Math.Poly2_s.poly -> b: Vale.Math.Poly2_s.poly
-> Vale.PPC64LE.QuickCode.va_quickCode Prims.unit
(Vale.AES.PPC64LE.GF128_Mul.va_code_ReduceMulRev128 ()) | {
"end_col": 37,
"end_line": 176,
"start_col": 2,
"start_line": 174
} |
Prims.Tot | val typeof (#t: Type0) (td: typedef t) : Tot Type0 | [
{
"abbrev": true,
"full_module": "Steel.FractionalPermission",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let typeof (#t: Type0) (td: typedef t) : Tot Type0 = t | val typeof (#t: Type0) (td: typedef t) : Tot Type0
let typeof (#t: Type0) (td: typedef t) : Tot Type0 = | false | null | false | t | {
"checked_file": "Steel.ST.C.Types.Base.fsti.checked",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"prims.fst.checked",
"FStar.StrongExcludedMiddle.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.ST.C.Types.Base.fsti"
} | [
"total"
] | [
"Steel.ST.C.Types.Base.typedef"
] | [] | module Steel.ST.C.Types.Base
open Steel.ST.Util
module P = Steel.FractionalPermission
/// Helper to compose two permissions into one
val prod_perm (p1 p2: P.perm) : Pure P.perm
(requires True)
(ensures (fun p ->
((p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm) ==>
p `P.lesser_equal_perm` P.full_perm) /\
p.v == (let open FStar.Real in p1.v *. p2.v)
))
[@@noextract_to "krml"] // proof-only
val typedef (t: Type0) : Type0 | false | false | Steel.ST.C.Types.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val typeof (#t: Type0) (td: typedef t) : Tot Type0 | [] | Steel.ST.C.Types.Base.typeof | {
"file_name": "lib/steel/c/Steel.ST.C.Types.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | td: Steel.ST.C.Types.Base.typedef t -> Type0 | {
"end_col": 54,
"end_line": 19,
"start_col": 53,
"start_line": 19
} |
Prims.Tot | val null (#t: Type) (td: typedef t) : Tot (ptr td) | [
{
"abbrev": true,
"full_module": "Steel.FractionalPermission",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let null (#t: Type) (td: typedef t) : Tot (ptr td) = null_gen t | val null (#t: Type) (td: typedef t) : Tot (ptr td)
let null (#t: Type) (td: typedef t) : Tot (ptr td) = | false | null | false | null_gen t | {
"checked_file": "Steel.ST.C.Types.Base.fsti.checked",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"prims.fst.checked",
"FStar.StrongExcludedMiddle.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.ST.C.Types.Base.fsti"
} | [
"total"
] | [
"Steel.ST.C.Types.Base.typedef",
"Steel.ST.C.Types.Base.null_gen",
"Steel.ST.C.Types.Base.ptr"
] | [] | module Steel.ST.C.Types.Base
open Steel.ST.Util
module P = Steel.FractionalPermission
/// Helper to compose two permissions into one
val prod_perm (p1 p2: P.perm) : Pure P.perm
(requires True)
(ensures (fun p ->
((p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm) ==>
p `P.lesser_equal_perm` P.full_perm) /\
p.v == (let open FStar.Real in p1.v *. p2.v)
))
[@@noextract_to "krml"] // proof-only
val typedef (t: Type0) : Type0
inline_for_extraction [@@noextract_to "krml"]
let typeof (#t: Type0) (td: typedef t) : Tot Type0 = t
val fractionable (#t: Type0) (td: typedef t) (x: t) : GTot prop
val mk_fraction (#t: Type0) (td: typedef t) (x: t) (p: P.perm) : Ghost t
(requires (fractionable td x))
(ensures (fun y -> p `P.lesser_equal_perm` P.full_perm ==> fractionable td y))
val mk_fraction_full (#t: Type0) (td: typedef t) (x: t) : Lemma
(requires (fractionable td x))
(ensures (mk_fraction td x P.full_perm == x))
[SMTPat (mk_fraction td x P.full_perm)]
val mk_fraction_compose (#t: Type0) (td: typedef t) (x: t) (p1 p2: P.perm) : Lemma
(requires (fractionable td x /\ p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm))
(ensures (mk_fraction td (mk_fraction td x p1) p2 == mk_fraction td x (p1 `prod_perm` p2)))
val full (#t: Type0) (td: typedef t) (v: t) : GTot prop
val uninitialized (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> full td y /\ fractionable td y))
val unknown (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> fractionable td y))
val full_not_unknown
(#t: Type)
(td: typedef t)
(v: t)
: Lemma
(requires (full td v))
(ensures (~ (v == unknown td)))
[SMTPat (full td v)]
val mk_fraction_unknown (#t: Type0) (td: typedef t) (p: P.perm) : Lemma
(ensures (mk_fraction td (unknown td) p == unknown td))
val mk_fraction_eq_unknown (#t: Type0) (td: typedef t) (v: t) (p: P.perm) : Lemma
(requires (fractionable td v /\ mk_fraction td v p == unknown td))
(ensures (v == unknown td))
// To be extracted as: void*
[@@noextract_to "krml"] // primitive
val void_ptr : Type0
// To be extracted as: NULL
[@@noextract_to "krml"] // primitive
val void_null: void_ptr
// To be extracted as: *t
[@@noextract_to "krml"] // primitive
val ptr_gen ([@@@unused] t: Type) : Type0
[@@noextract_to "krml"] // primitive
val null_gen (t: Type) : Tot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen (#[@@@unused] t: Type) (x: ptr_gen t) : GTot void_ptr
val ghost_ptr_gen_of_void_ptr (x: void_ptr) ([@@@unused] t: Type) : GTot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen_of_void_ptr
(x: void_ptr)
(t: Type)
: Lemma
(ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t) == x)
[SMTPat (ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t))]
val ghost_ptr_gen_of_void_ptr_of_ptr_gen
(#t: Type)
(x: ptr_gen t)
: Lemma
(ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t == x)
[SMTPat (ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t)]
inline_for_extraction [@@noextract_to "krml"] // primitive
let ptr (#t: Type) (td: typedef t) : Tot Type0 = ptr_gen t | false | false | Steel.ST.C.Types.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val null (#t: Type) (td: typedef t) : Tot (ptr td) | [] | Steel.ST.C.Types.Base.null | {
"file_name": "lib/steel/c/Steel.ST.C.Types.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | td: Steel.ST.C.Types.Base.typedef t -> Steel.ST.C.Types.Base.ptr td | {
"end_col": 63,
"end_line": 98,
"start_col": 53,
"start_line": 98
} |
Prims.Tot | val ptr (#t: Type) (td: typedef t) : Tot Type0 | [
{
"abbrev": true,
"full_module": "Steel.FractionalPermission",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let ptr (#t: Type) (td: typedef t) : Tot Type0 = ptr_gen t | val ptr (#t: Type) (td: typedef t) : Tot Type0
let ptr (#t: Type) (td: typedef t) : Tot Type0 = | false | null | false | ptr_gen t | {
"checked_file": "Steel.ST.C.Types.Base.fsti.checked",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"prims.fst.checked",
"FStar.StrongExcludedMiddle.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.ST.C.Types.Base.fsti"
} | [
"total"
] | [
"Steel.ST.C.Types.Base.typedef",
"Steel.ST.C.Types.Base.ptr_gen"
] | [] | module Steel.ST.C.Types.Base
open Steel.ST.Util
module P = Steel.FractionalPermission
/// Helper to compose two permissions into one
val prod_perm (p1 p2: P.perm) : Pure P.perm
(requires True)
(ensures (fun p ->
((p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm) ==>
p `P.lesser_equal_perm` P.full_perm) /\
p.v == (let open FStar.Real in p1.v *. p2.v)
))
[@@noextract_to "krml"] // proof-only
val typedef (t: Type0) : Type0
inline_for_extraction [@@noextract_to "krml"]
let typeof (#t: Type0) (td: typedef t) : Tot Type0 = t
val fractionable (#t: Type0) (td: typedef t) (x: t) : GTot prop
val mk_fraction (#t: Type0) (td: typedef t) (x: t) (p: P.perm) : Ghost t
(requires (fractionable td x))
(ensures (fun y -> p `P.lesser_equal_perm` P.full_perm ==> fractionable td y))
val mk_fraction_full (#t: Type0) (td: typedef t) (x: t) : Lemma
(requires (fractionable td x))
(ensures (mk_fraction td x P.full_perm == x))
[SMTPat (mk_fraction td x P.full_perm)]
val mk_fraction_compose (#t: Type0) (td: typedef t) (x: t) (p1 p2: P.perm) : Lemma
(requires (fractionable td x /\ p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm))
(ensures (mk_fraction td (mk_fraction td x p1) p2 == mk_fraction td x (p1 `prod_perm` p2)))
val full (#t: Type0) (td: typedef t) (v: t) : GTot prop
val uninitialized (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> full td y /\ fractionable td y))
val unknown (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> fractionable td y))
val full_not_unknown
(#t: Type)
(td: typedef t)
(v: t)
: Lemma
(requires (full td v))
(ensures (~ (v == unknown td)))
[SMTPat (full td v)]
val mk_fraction_unknown (#t: Type0) (td: typedef t) (p: P.perm) : Lemma
(ensures (mk_fraction td (unknown td) p == unknown td))
val mk_fraction_eq_unknown (#t: Type0) (td: typedef t) (v: t) (p: P.perm) : Lemma
(requires (fractionable td v /\ mk_fraction td v p == unknown td))
(ensures (v == unknown td))
// To be extracted as: void*
[@@noextract_to "krml"] // primitive
val void_ptr : Type0
// To be extracted as: NULL
[@@noextract_to "krml"] // primitive
val void_null: void_ptr
// To be extracted as: *t
[@@noextract_to "krml"] // primitive
val ptr_gen ([@@@unused] t: Type) : Type0
[@@noextract_to "krml"] // primitive
val null_gen (t: Type) : Tot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen (#[@@@unused] t: Type) (x: ptr_gen t) : GTot void_ptr
val ghost_ptr_gen_of_void_ptr (x: void_ptr) ([@@@unused] t: Type) : GTot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen_of_void_ptr
(x: void_ptr)
(t: Type)
: Lemma
(ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t) == x)
[SMTPat (ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t))]
val ghost_ptr_gen_of_void_ptr_of_ptr_gen
(#t: Type)
(x: ptr_gen t)
: Lemma
(ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t == x)
[SMTPat (ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t)] | false | false | Steel.ST.C.Types.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val ptr (#t: Type) (td: typedef t) : Tot Type0 | [] | Steel.ST.C.Types.Base.ptr | {
"file_name": "lib/steel/c/Steel.ST.C.Types.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | td: Steel.ST.C.Types.Base.typedef t -> Type0 | {
"end_col": 58,
"end_line": 96,
"start_col": 49,
"start_line": 96
} |
Prims.Tot | val ref (#t: Type) (td: typedef t) : Tot Type0 | [
{
"abbrev": true,
"full_module": "Steel.FractionalPermission",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let ref (#t: Type) (td: typedef t) : Tot Type0 = (p: ptr td { ~ (p == null td) }) | val ref (#t: Type) (td: typedef t) : Tot Type0
let ref (#t: Type) (td: typedef t) : Tot Type0 = | false | null | false | (p: ptr td {~(p == null td)}) | {
"checked_file": "Steel.ST.C.Types.Base.fsti.checked",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"prims.fst.checked",
"FStar.StrongExcludedMiddle.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.ST.C.Types.Base.fsti"
} | [
"total"
] | [
"Steel.ST.C.Types.Base.typedef",
"Steel.ST.C.Types.Base.ptr",
"Prims.l_not",
"Prims.eq2",
"Steel.ST.C.Types.Base.null"
] | [] | module Steel.ST.C.Types.Base
open Steel.ST.Util
module P = Steel.FractionalPermission
/// Helper to compose two permissions into one
val prod_perm (p1 p2: P.perm) : Pure P.perm
(requires True)
(ensures (fun p ->
((p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm) ==>
p `P.lesser_equal_perm` P.full_perm) /\
p.v == (let open FStar.Real in p1.v *. p2.v)
))
[@@noextract_to "krml"] // proof-only
val typedef (t: Type0) : Type0
inline_for_extraction [@@noextract_to "krml"]
let typeof (#t: Type0) (td: typedef t) : Tot Type0 = t
val fractionable (#t: Type0) (td: typedef t) (x: t) : GTot prop
val mk_fraction (#t: Type0) (td: typedef t) (x: t) (p: P.perm) : Ghost t
(requires (fractionable td x))
(ensures (fun y -> p `P.lesser_equal_perm` P.full_perm ==> fractionable td y))
val mk_fraction_full (#t: Type0) (td: typedef t) (x: t) : Lemma
(requires (fractionable td x))
(ensures (mk_fraction td x P.full_perm == x))
[SMTPat (mk_fraction td x P.full_perm)]
val mk_fraction_compose (#t: Type0) (td: typedef t) (x: t) (p1 p2: P.perm) : Lemma
(requires (fractionable td x /\ p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm))
(ensures (mk_fraction td (mk_fraction td x p1) p2 == mk_fraction td x (p1 `prod_perm` p2)))
val full (#t: Type0) (td: typedef t) (v: t) : GTot prop
val uninitialized (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> full td y /\ fractionable td y))
val unknown (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> fractionable td y))
val full_not_unknown
(#t: Type)
(td: typedef t)
(v: t)
: Lemma
(requires (full td v))
(ensures (~ (v == unknown td)))
[SMTPat (full td v)]
val mk_fraction_unknown (#t: Type0) (td: typedef t) (p: P.perm) : Lemma
(ensures (mk_fraction td (unknown td) p == unknown td))
val mk_fraction_eq_unknown (#t: Type0) (td: typedef t) (v: t) (p: P.perm) : Lemma
(requires (fractionable td v /\ mk_fraction td v p == unknown td))
(ensures (v == unknown td))
// To be extracted as: void*
[@@noextract_to "krml"] // primitive
val void_ptr : Type0
// To be extracted as: NULL
[@@noextract_to "krml"] // primitive
val void_null: void_ptr
// To be extracted as: *t
[@@noextract_to "krml"] // primitive
val ptr_gen ([@@@unused] t: Type) : Type0
[@@noextract_to "krml"] // primitive
val null_gen (t: Type) : Tot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen (#[@@@unused] t: Type) (x: ptr_gen t) : GTot void_ptr
val ghost_ptr_gen_of_void_ptr (x: void_ptr) ([@@@unused] t: Type) : GTot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen_of_void_ptr
(x: void_ptr)
(t: Type)
: Lemma
(ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t) == x)
[SMTPat (ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t))]
val ghost_ptr_gen_of_void_ptr_of_ptr_gen
(#t: Type)
(x: ptr_gen t)
: Lemma
(ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t == x)
[SMTPat (ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t)]
inline_for_extraction [@@noextract_to "krml"] // primitive
let ptr (#t: Type) (td: typedef t) : Tot Type0 = ptr_gen t
inline_for_extraction [@@noextract_to "krml"] // primitive
let null (#t: Type) (td: typedef t) : Tot (ptr td) = null_gen t | false | false | Steel.ST.C.Types.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val ref (#t: Type) (td: typedef t) : Tot Type0 | [] | Steel.ST.C.Types.Base.ref | {
"file_name": "lib/steel/c/Steel.ST.C.Types.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | td: Steel.ST.C.Types.Base.typedef t -> Type0 | {
"end_col": 81,
"end_line": 101,
"start_col": 49,
"start_line": 101
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "Steel.FractionalPermission",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let norm_field_steps = [
delta_attr [`%norm_field_attr];
iota; zeta; primops;
] | let norm_field_steps = | false | null | false | [delta_attr [`%norm_field_attr]; iota; zeta; primops] | {
"checked_file": "Steel.ST.C.Types.Base.fsti.checked",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"prims.fst.checked",
"FStar.StrongExcludedMiddle.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.ST.C.Types.Base.fsti"
} | [
"total"
] | [
"Prims.Cons",
"FStar.Pervasives.norm_step",
"FStar.Pervasives.delta_attr",
"Prims.string",
"Prims.Nil",
"FStar.Pervasives.iota",
"FStar.Pervasives.zeta",
"FStar.Pervasives.primops"
] | [] | module Steel.ST.C.Types.Base
open Steel.ST.Util
module P = Steel.FractionalPermission
/// Helper to compose two permissions into one
val prod_perm (p1 p2: P.perm) : Pure P.perm
(requires True)
(ensures (fun p ->
((p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm) ==>
p `P.lesser_equal_perm` P.full_perm) /\
p.v == (let open FStar.Real in p1.v *. p2.v)
))
[@@noextract_to "krml"] // proof-only
val typedef (t: Type0) : Type0
inline_for_extraction [@@noextract_to "krml"]
let typeof (#t: Type0) (td: typedef t) : Tot Type0 = t
val fractionable (#t: Type0) (td: typedef t) (x: t) : GTot prop
val mk_fraction (#t: Type0) (td: typedef t) (x: t) (p: P.perm) : Ghost t
(requires (fractionable td x))
(ensures (fun y -> p `P.lesser_equal_perm` P.full_perm ==> fractionable td y))
val mk_fraction_full (#t: Type0) (td: typedef t) (x: t) : Lemma
(requires (fractionable td x))
(ensures (mk_fraction td x P.full_perm == x))
[SMTPat (mk_fraction td x P.full_perm)]
val mk_fraction_compose (#t: Type0) (td: typedef t) (x: t) (p1 p2: P.perm) : Lemma
(requires (fractionable td x /\ p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm))
(ensures (mk_fraction td (mk_fraction td x p1) p2 == mk_fraction td x (p1 `prod_perm` p2)))
val full (#t: Type0) (td: typedef t) (v: t) : GTot prop
val uninitialized (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> full td y /\ fractionable td y))
val unknown (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> fractionable td y))
val full_not_unknown
(#t: Type)
(td: typedef t)
(v: t)
: Lemma
(requires (full td v))
(ensures (~ (v == unknown td)))
[SMTPat (full td v)]
val mk_fraction_unknown (#t: Type0) (td: typedef t) (p: P.perm) : Lemma
(ensures (mk_fraction td (unknown td) p == unknown td))
val mk_fraction_eq_unknown (#t: Type0) (td: typedef t) (v: t) (p: P.perm) : Lemma
(requires (fractionable td v /\ mk_fraction td v p == unknown td))
(ensures (v == unknown td))
// To be extracted as: void*
[@@noextract_to "krml"] // primitive
val void_ptr : Type0
// To be extracted as: NULL
[@@noextract_to "krml"] // primitive
val void_null: void_ptr
// To be extracted as: *t
[@@noextract_to "krml"] // primitive
val ptr_gen ([@@@unused] t: Type) : Type0
[@@noextract_to "krml"] // primitive
val null_gen (t: Type) : Tot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen (#[@@@unused] t: Type) (x: ptr_gen t) : GTot void_ptr
val ghost_ptr_gen_of_void_ptr (x: void_ptr) ([@@@unused] t: Type) : GTot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen_of_void_ptr
(x: void_ptr)
(t: Type)
: Lemma
(ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t) == x)
[SMTPat (ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t))]
val ghost_ptr_gen_of_void_ptr_of_ptr_gen
(#t: Type)
(x: ptr_gen t)
: Lemma
(ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t == x)
[SMTPat (ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t)]
inline_for_extraction [@@noextract_to "krml"] // primitive
let ptr (#t: Type) (td: typedef t) : Tot Type0 = ptr_gen t
inline_for_extraction [@@noextract_to "krml"] // primitive
let null (#t: Type) (td: typedef t) : Tot (ptr td) = null_gen t
inline_for_extraction [@@noextract_to "krml"]
let ref (#t: Type) (td: typedef t) : Tot Type0 = (p: ptr td { ~ (p == null td) })
val pts_to (#t: Type) (#td: typedef t) (r: ref td) ([@@@smt_fallback] v: Ghost.erased t) : vprop
let pts_to_or_null
(#t: Type) (#td: typedef t) (p: ptr td) (v: Ghost.erased t) : vprop
= if FStar.StrongExcludedMiddle.strong_excluded_middle (p == null _)
then emp
else pts_to p v
[@@noextract_to "krml"] // primitive
val is_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STAtomicBase bool false opened Unobservable
(pts_to_or_null p v)
(fun _ -> pts_to_or_null p v)
(True)
(fun res -> res == true <==> p == null _)
let assert_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost unit opened
(pts_to_or_null p v)
(fun _ -> emp)
(p == null _)
(fun _ -> True)
= rewrite (pts_to_or_null p v) emp
let assert_not_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost (squash (~ (p == null _))) opened
(pts_to_or_null p v)
(fun _ -> pts_to p v)
(~ (p == null _))
(fun _ -> True)
= rewrite (pts_to_or_null p v) (pts_to p v)
[@@noextract_to "krml"] // primitive
val void_ptr_of_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ptr td) : STAtomicBase void_ptr false opened Unobservable
(pts_to_or_null x v)
(fun _ -> pts_to_or_null x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x)
[@@noextract_to "krml"] inline_for_extraction
let void_ptr_of_ref (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ref td) : STAtomicBase void_ptr false opened Unobservable
(pts_to x v)
(fun _ -> pts_to x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x)
= rewrite (pts_to x v) (pts_to_or_null x v);
let res = void_ptr_of_ptr x in
rewrite (pts_to_or_null x v) (pts_to x v);
return res
[@@noextract_to "krml"] // primitive
val ptr_of_void_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: void_ptr) : STAtomicBase (ptr td) false opened Unobservable
(pts_to_or_null (ghost_ptr_gen_of_void_ptr x t <: ptr td) v)
(fun y -> pts_to_or_null y v)
True
(fun y -> y == ghost_ptr_gen_of_void_ptr x t)
[@@noextract_to "krml"] inline_for_extraction
let ref_of_void_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: void_ptr) (y': Ghost.erased (ref td)) : STAtomicBase (ref td) false opened Unobservable
(pts_to y' v)
(fun y -> pts_to y v)
(Ghost.reveal y' == ghost_ptr_gen_of_void_ptr x t)
(fun y -> y == Ghost.reveal y')
= rewrite (pts_to y' v) (pts_to_or_null (ghost_ptr_gen_of_void_ptr x t <: ptr td) v);
let y = ptr_of_void_ptr x in
rewrite (pts_to_or_null y v) (pts_to y v);
return y
val ref_equiv
(#t: Type)
(#td: typedef t)
(r1 r2: ref td)
: Tot vprop
val pts_to_equiv
(#opened: _)
(#t: Type)
(#td: typedef t)
(r1 r2: ref td)
(v: Ghost.erased t)
: STGhostT unit opened
(ref_equiv r1 r2 `star` pts_to r1 v)
(fun _ -> ref_equiv r1 r2 `star` pts_to r2 v)
val freeable
(#t: Type)
(#td: typedef t)
(r: ref td)
: Tot vprop
val freeable_dup
(#opened: _)
(#t: Type)
(#td: typedef t)
(r: ref td)
: STGhostT unit opened
(freeable r)
(fun _ -> freeable r `star` freeable r)
val freeable_equiv
(#opened: _)
(#t: Type)
(#td: typedef t)
(r1 r2: ref td)
: STGhostT unit opened
(ref_equiv r1 r2 `star` freeable r1)
(fun _ -> ref_equiv r1 r2 `star` freeable r2)
let freeable_or_null
(#t: Type)
(#td: typedef t)
(r: ptr td)
: Tot vprop
= if FStar.StrongExcludedMiddle.strong_excluded_middle (r == null _)
then emp
else freeable r
(*
let freeable_or_null_dup
(#opened: _)
(#t: Type)
(#td: typedef t)
(r: ptr td)
: SteelGhostT vprop opened
(freeable_or_null r)
(fun _ -> freeable_or_null r `star` freeable_or_null r)
= if FStar.StrongExcludedMiddle.strong_excluded_middle (r == null _)
then ()
else freeable r
*)
[@@noextract_to "krml"] // primitive
val alloc
(#t: Type)
(td: typedef t)
: STT (ptr td)
emp
(fun p -> pts_to_or_null p (uninitialized td) `star` freeable_or_null p)
[@@noextract_to "krml"] // primitive
val free
(#t: Type)
(#td: typedef t)
(#v: Ghost.erased t)
(r: ref td)
: ST unit
(pts_to r v `star` freeable r)
(fun _ -> emp)
(
full td v
)
(fun _ -> True)
val mk_fraction_split_gen
(#opened: _)
(#t: Type) (#td: typedef t) (r: ref td) (v: t { fractionable td v }) (p p1 p2: P.perm) : STGhost unit opened
(pts_to r (mk_fraction td v p))
(fun _ -> pts_to r (mk_fraction td v p1) `star` pts_to r (mk_fraction td v p2))
(p == p1 `P.sum_perm` p2 /\ p `P.lesser_equal_perm` P.full_perm)
(fun _ -> True)
let mk_fraction_split
(#opened: _)
(#t: Type) (#td: typedef t) (r: ref td) (v: Ghost.erased t { fractionable td v }) (p1 p2: P.perm) : STGhost unit opened
(pts_to r v)
(fun _ -> pts_to r (mk_fraction td v p1) `star` pts_to r (mk_fraction td v p2))
(P.full_perm == p1 `P.sum_perm` p2)
(fun _ -> True)
= mk_fraction_full td v;
rewrite (pts_to _ _) (pts_to _ _);
mk_fraction_split_gen r v P.full_perm p1 p2
val mk_fraction_join
(#opened: _)
(#t: Type) (#td: typedef t) (r: ref td) (v: t { fractionable td v }) (p1 p2: P.perm)
: STGhostT unit opened
(pts_to r (mk_fraction td v p1) `star` pts_to r (mk_fraction td v p2))
(fun _ -> pts_to r (mk_fraction td v (p1 `P.sum_perm` p2)))
val fractional_permissions_theorem
(#opened: _)
(#t: Type)
(#td: typedef t)
(v1: t { fractionable td v1 })
(v2: t { fractionable td v2 })
(p1 p2: P.perm)
(r: ref td)
: STGhost unit opened
(pts_to r (mk_fraction td v1 p1) `star` pts_to r (mk_fraction td v2 p2))
(fun _ -> pts_to r (mk_fraction td v1 p1) `star` pts_to r (mk_fraction td v2 p2))
(full td v1 /\ full td v2)
(fun _ -> v1 == v2 /\ (p1 `P.sum_perm` p2) `P.lesser_equal_perm` P.full_perm)
[@@noextract_to "krml"] // primitive
val copy
(#t: Type)
(#td: typedef t)
(#v_src: Ghost.erased t { full td v_src /\ fractionable td v_src })
(#p_src: P.perm)
(#v_dst: Ghost.erased t { full td v_dst })
(src: ref td)
(dst: ref td)
: STT unit
(pts_to src (mk_fraction td v_src p_src) `star` pts_to dst v_dst)
(fun _ -> pts_to src (mk_fraction td v_src p_src) `star` pts_to dst v_src)
val norm_field_attr : unit | false | true | Steel.ST.C.Types.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val norm_field_steps : Prims.list FStar.Pervasives.norm_step | [] | Steel.ST.C.Types.Base.norm_field_steps | {
"file_name": "lib/steel/c/Steel.ST.C.Types.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | Prims.list FStar.Pervasives.norm_step | {
"end_col": 1,
"end_line": 330,
"start_col": 23,
"start_line": 327
} |
|
Prims.Tot | val pts_to_or_null (#t: Type) (#td: typedef t) (p: ptr td) (v: Ghost.erased t) : vprop | [
{
"abbrev": true,
"full_module": "Steel.FractionalPermission",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let pts_to_or_null
(#t: Type) (#td: typedef t) (p: ptr td) (v: Ghost.erased t) : vprop
= if FStar.StrongExcludedMiddle.strong_excluded_middle (p == null _)
then emp
else pts_to p v | val pts_to_or_null (#t: Type) (#td: typedef t) (p: ptr td) (v: Ghost.erased t) : vprop
let pts_to_or_null (#t: Type) (#td: typedef t) (p: ptr td) (v: Ghost.erased t) : vprop = | false | null | false | if FStar.StrongExcludedMiddle.strong_excluded_middle (p == null _) then emp else pts_to p v | {
"checked_file": "Steel.ST.C.Types.Base.fsti.checked",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"prims.fst.checked",
"FStar.StrongExcludedMiddle.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.ST.C.Types.Base.fsti"
} | [
"total"
] | [
"Steel.ST.C.Types.Base.typedef",
"Steel.ST.C.Types.Base.ptr",
"FStar.Ghost.erased",
"FStar.StrongExcludedMiddle.strong_excluded_middle",
"Prims.eq2",
"Steel.ST.C.Types.Base.null",
"Steel.Effect.Common.emp",
"Prims.bool",
"Steel.ST.C.Types.Base.pts_to",
"Steel.Effect.Common.vprop"
] | [] | module Steel.ST.C.Types.Base
open Steel.ST.Util
module P = Steel.FractionalPermission
/// Helper to compose two permissions into one
val prod_perm (p1 p2: P.perm) : Pure P.perm
(requires True)
(ensures (fun p ->
((p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm) ==>
p `P.lesser_equal_perm` P.full_perm) /\
p.v == (let open FStar.Real in p1.v *. p2.v)
))
[@@noextract_to "krml"] // proof-only
val typedef (t: Type0) : Type0
inline_for_extraction [@@noextract_to "krml"]
let typeof (#t: Type0) (td: typedef t) : Tot Type0 = t
val fractionable (#t: Type0) (td: typedef t) (x: t) : GTot prop
val mk_fraction (#t: Type0) (td: typedef t) (x: t) (p: P.perm) : Ghost t
(requires (fractionable td x))
(ensures (fun y -> p `P.lesser_equal_perm` P.full_perm ==> fractionable td y))
val mk_fraction_full (#t: Type0) (td: typedef t) (x: t) : Lemma
(requires (fractionable td x))
(ensures (mk_fraction td x P.full_perm == x))
[SMTPat (mk_fraction td x P.full_perm)]
val mk_fraction_compose (#t: Type0) (td: typedef t) (x: t) (p1 p2: P.perm) : Lemma
(requires (fractionable td x /\ p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm))
(ensures (mk_fraction td (mk_fraction td x p1) p2 == mk_fraction td x (p1 `prod_perm` p2)))
val full (#t: Type0) (td: typedef t) (v: t) : GTot prop
val uninitialized (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> full td y /\ fractionable td y))
val unknown (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> fractionable td y))
val full_not_unknown
(#t: Type)
(td: typedef t)
(v: t)
: Lemma
(requires (full td v))
(ensures (~ (v == unknown td)))
[SMTPat (full td v)]
val mk_fraction_unknown (#t: Type0) (td: typedef t) (p: P.perm) : Lemma
(ensures (mk_fraction td (unknown td) p == unknown td))
val mk_fraction_eq_unknown (#t: Type0) (td: typedef t) (v: t) (p: P.perm) : Lemma
(requires (fractionable td v /\ mk_fraction td v p == unknown td))
(ensures (v == unknown td))
// To be extracted as: void*
[@@noextract_to "krml"] // primitive
val void_ptr : Type0
// To be extracted as: NULL
[@@noextract_to "krml"] // primitive
val void_null: void_ptr
// To be extracted as: *t
[@@noextract_to "krml"] // primitive
val ptr_gen ([@@@unused] t: Type) : Type0
[@@noextract_to "krml"] // primitive
val null_gen (t: Type) : Tot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen (#[@@@unused] t: Type) (x: ptr_gen t) : GTot void_ptr
val ghost_ptr_gen_of_void_ptr (x: void_ptr) ([@@@unused] t: Type) : GTot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen_of_void_ptr
(x: void_ptr)
(t: Type)
: Lemma
(ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t) == x)
[SMTPat (ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t))]
val ghost_ptr_gen_of_void_ptr_of_ptr_gen
(#t: Type)
(x: ptr_gen t)
: Lemma
(ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t == x)
[SMTPat (ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t)]
inline_for_extraction [@@noextract_to "krml"] // primitive
let ptr (#t: Type) (td: typedef t) : Tot Type0 = ptr_gen t
inline_for_extraction [@@noextract_to "krml"] // primitive
let null (#t: Type) (td: typedef t) : Tot (ptr td) = null_gen t
inline_for_extraction [@@noextract_to "krml"]
let ref (#t: Type) (td: typedef t) : Tot Type0 = (p: ptr td { ~ (p == null td) })
val pts_to (#t: Type) (#td: typedef t) (r: ref td) ([@@@smt_fallback] v: Ghost.erased t) : vprop
let pts_to_or_null | false | false | Steel.ST.C.Types.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val pts_to_or_null (#t: Type) (#td: typedef t) (p: ptr td) (v: Ghost.erased t) : vprop | [] | Steel.ST.C.Types.Base.pts_to_or_null | {
"file_name": "lib/steel/c/Steel.ST.C.Types.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p: Steel.ST.C.Types.Base.ptr td -> v: FStar.Ghost.erased t -> Steel.Effect.Common.vprop | {
"end_col": 17,
"end_line": 109,
"start_col": 2,
"start_line": 107
} |
Prims.Tot | val freeable_or_null (#t: Type) (#td: typedef t) (r: ptr td) : Tot vprop | [
{
"abbrev": true,
"full_module": "Steel.FractionalPermission",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let freeable_or_null
(#t: Type)
(#td: typedef t)
(r: ptr td)
: Tot vprop
= if FStar.StrongExcludedMiddle.strong_excluded_middle (r == null _)
then emp
else freeable r | val freeable_or_null (#t: Type) (#td: typedef t) (r: ptr td) : Tot vprop
let freeable_or_null (#t: Type) (#td: typedef t) (r: ptr td) : Tot vprop = | false | null | false | if FStar.StrongExcludedMiddle.strong_excluded_middle (r == null _) then emp else freeable r | {
"checked_file": "Steel.ST.C.Types.Base.fsti.checked",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"prims.fst.checked",
"FStar.StrongExcludedMiddle.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.ST.C.Types.Base.fsti"
} | [
"total"
] | [
"Steel.ST.C.Types.Base.typedef",
"Steel.ST.C.Types.Base.ptr",
"FStar.StrongExcludedMiddle.strong_excluded_middle",
"Prims.eq2",
"Steel.ST.C.Types.Base.null",
"Steel.Effect.Common.emp",
"Prims.bool",
"Steel.ST.C.Types.Base.freeable",
"Steel.Effect.Common.vprop"
] | [] | module Steel.ST.C.Types.Base
open Steel.ST.Util
module P = Steel.FractionalPermission
/// Helper to compose two permissions into one
val prod_perm (p1 p2: P.perm) : Pure P.perm
(requires True)
(ensures (fun p ->
((p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm) ==>
p `P.lesser_equal_perm` P.full_perm) /\
p.v == (let open FStar.Real in p1.v *. p2.v)
))
[@@noextract_to "krml"] // proof-only
val typedef (t: Type0) : Type0
inline_for_extraction [@@noextract_to "krml"]
let typeof (#t: Type0) (td: typedef t) : Tot Type0 = t
val fractionable (#t: Type0) (td: typedef t) (x: t) : GTot prop
val mk_fraction (#t: Type0) (td: typedef t) (x: t) (p: P.perm) : Ghost t
(requires (fractionable td x))
(ensures (fun y -> p `P.lesser_equal_perm` P.full_perm ==> fractionable td y))
val mk_fraction_full (#t: Type0) (td: typedef t) (x: t) : Lemma
(requires (fractionable td x))
(ensures (mk_fraction td x P.full_perm == x))
[SMTPat (mk_fraction td x P.full_perm)]
val mk_fraction_compose (#t: Type0) (td: typedef t) (x: t) (p1 p2: P.perm) : Lemma
(requires (fractionable td x /\ p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm))
(ensures (mk_fraction td (mk_fraction td x p1) p2 == mk_fraction td x (p1 `prod_perm` p2)))
val full (#t: Type0) (td: typedef t) (v: t) : GTot prop
val uninitialized (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> full td y /\ fractionable td y))
val unknown (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> fractionable td y))
val full_not_unknown
(#t: Type)
(td: typedef t)
(v: t)
: Lemma
(requires (full td v))
(ensures (~ (v == unknown td)))
[SMTPat (full td v)]
val mk_fraction_unknown (#t: Type0) (td: typedef t) (p: P.perm) : Lemma
(ensures (mk_fraction td (unknown td) p == unknown td))
val mk_fraction_eq_unknown (#t: Type0) (td: typedef t) (v: t) (p: P.perm) : Lemma
(requires (fractionable td v /\ mk_fraction td v p == unknown td))
(ensures (v == unknown td))
// To be extracted as: void*
[@@noextract_to "krml"] // primitive
val void_ptr : Type0
// To be extracted as: NULL
[@@noextract_to "krml"] // primitive
val void_null: void_ptr
// To be extracted as: *t
[@@noextract_to "krml"] // primitive
val ptr_gen ([@@@unused] t: Type) : Type0
[@@noextract_to "krml"] // primitive
val null_gen (t: Type) : Tot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen (#[@@@unused] t: Type) (x: ptr_gen t) : GTot void_ptr
val ghost_ptr_gen_of_void_ptr (x: void_ptr) ([@@@unused] t: Type) : GTot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen_of_void_ptr
(x: void_ptr)
(t: Type)
: Lemma
(ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t) == x)
[SMTPat (ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t))]
val ghost_ptr_gen_of_void_ptr_of_ptr_gen
(#t: Type)
(x: ptr_gen t)
: Lemma
(ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t == x)
[SMTPat (ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t)]
inline_for_extraction [@@noextract_to "krml"] // primitive
let ptr (#t: Type) (td: typedef t) : Tot Type0 = ptr_gen t
inline_for_extraction [@@noextract_to "krml"] // primitive
let null (#t: Type) (td: typedef t) : Tot (ptr td) = null_gen t
inline_for_extraction [@@noextract_to "krml"]
let ref (#t: Type) (td: typedef t) : Tot Type0 = (p: ptr td { ~ (p == null td) })
val pts_to (#t: Type) (#td: typedef t) (r: ref td) ([@@@smt_fallback] v: Ghost.erased t) : vprop
let pts_to_or_null
(#t: Type) (#td: typedef t) (p: ptr td) (v: Ghost.erased t) : vprop
= if FStar.StrongExcludedMiddle.strong_excluded_middle (p == null _)
then emp
else pts_to p v
[@@noextract_to "krml"] // primitive
val is_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STAtomicBase bool false opened Unobservable
(pts_to_or_null p v)
(fun _ -> pts_to_or_null p v)
(True)
(fun res -> res == true <==> p == null _)
let assert_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost unit opened
(pts_to_or_null p v)
(fun _ -> emp)
(p == null _)
(fun _ -> True)
= rewrite (pts_to_or_null p v) emp
let assert_not_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost (squash (~ (p == null _))) opened
(pts_to_or_null p v)
(fun _ -> pts_to p v)
(~ (p == null _))
(fun _ -> True)
= rewrite (pts_to_or_null p v) (pts_to p v)
[@@noextract_to "krml"] // primitive
val void_ptr_of_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ptr td) : STAtomicBase void_ptr false opened Unobservable
(pts_to_or_null x v)
(fun _ -> pts_to_or_null x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x)
[@@noextract_to "krml"] inline_for_extraction
let void_ptr_of_ref (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ref td) : STAtomicBase void_ptr false opened Unobservable
(pts_to x v)
(fun _ -> pts_to x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x)
= rewrite (pts_to x v) (pts_to_or_null x v);
let res = void_ptr_of_ptr x in
rewrite (pts_to_or_null x v) (pts_to x v);
return res
[@@noextract_to "krml"] // primitive
val ptr_of_void_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: void_ptr) : STAtomicBase (ptr td) false opened Unobservable
(pts_to_or_null (ghost_ptr_gen_of_void_ptr x t <: ptr td) v)
(fun y -> pts_to_or_null y v)
True
(fun y -> y == ghost_ptr_gen_of_void_ptr x t)
[@@noextract_to "krml"] inline_for_extraction
let ref_of_void_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: void_ptr) (y': Ghost.erased (ref td)) : STAtomicBase (ref td) false opened Unobservable
(pts_to y' v)
(fun y -> pts_to y v)
(Ghost.reveal y' == ghost_ptr_gen_of_void_ptr x t)
(fun y -> y == Ghost.reveal y')
= rewrite (pts_to y' v) (pts_to_or_null (ghost_ptr_gen_of_void_ptr x t <: ptr td) v);
let y = ptr_of_void_ptr x in
rewrite (pts_to_or_null y v) (pts_to y v);
return y
val ref_equiv
(#t: Type)
(#td: typedef t)
(r1 r2: ref td)
: Tot vprop
val pts_to_equiv
(#opened: _)
(#t: Type)
(#td: typedef t)
(r1 r2: ref td)
(v: Ghost.erased t)
: STGhostT unit opened
(ref_equiv r1 r2 `star` pts_to r1 v)
(fun _ -> ref_equiv r1 r2 `star` pts_to r2 v)
val freeable
(#t: Type)
(#td: typedef t)
(r: ref td)
: Tot vprop
val freeable_dup
(#opened: _)
(#t: Type)
(#td: typedef t)
(r: ref td)
: STGhostT unit opened
(freeable r)
(fun _ -> freeable r `star` freeable r)
val freeable_equiv
(#opened: _)
(#t: Type)
(#td: typedef t)
(r1 r2: ref td)
: STGhostT unit opened
(ref_equiv r1 r2 `star` freeable r1)
(fun _ -> ref_equiv r1 r2 `star` freeable r2)
let freeable_or_null
(#t: Type)
(#td: typedef t)
(r: ptr td) | false | false | Steel.ST.C.Types.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val freeable_or_null (#t: Type) (#td: typedef t) (r: ptr td) : Tot vprop | [] | Steel.ST.C.Types.Base.freeable_or_null | {
"file_name": "lib/steel/c/Steel.ST.C.Types.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | r: Steel.ST.C.Types.Base.ptr td -> Steel.Effect.Common.vprop | {
"end_col": 17,
"end_line": 233,
"start_col": 2,
"start_line": 231
} |
Steel.ST.Effect.Ghost.STGhost | val assert_null (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (p: ptr td)
: STGhost unit opened (pts_to_or_null p v) (fun _ -> emp) (p == null _) (fun _ -> True) | [
{
"abbrev": true,
"full_module": "Steel.FractionalPermission",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let assert_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost unit opened
(pts_to_or_null p v)
(fun _ -> emp)
(p == null _)
(fun _ -> True)
= rewrite (pts_to_or_null p v) emp | val assert_null (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (p: ptr td)
: STGhost unit opened (pts_to_or_null p v) (fun _ -> emp) (p == null _) (fun _ -> True)
let assert_null (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (p: ptr td)
: STGhost unit opened (pts_to_or_null p v) (fun _ -> emp) (p == null _) (fun _ -> True) = | true | null | false | rewrite (pts_to_or_null p v) emp | {
"checked_file": "Steel.ST.C.Types.Base.fsti.checked",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"prims.fst.checked",
"FStar.StrongExcludedMiddle.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.ST.C.Types.Base.fsti"
} | [] | [
"Steel.Memory.inames",
"Steel.ST.C.Types.Base.typedef",
"FStar.Ghost.erased",
"Steel.ST.C.Types.Base.ptr",
"Steel.ST.Util.rewrite",
"Steel.ST.C.Types.Base.pts_to_or_null",
"Steel.Effect.Common.emp",
"Prims.unit",
"Steel.Effect.Common.vprop",
"Prims.eq2",
"Steel.ST.C.Types.Base.null",
"Prims.l_True"
] | [] | module Steel.ST.C.Types.Base
open Steel.ST.Util
module P = Steel.FractionalPermission
/// Helper to compose two permissions into one
val prod_perm (p1 p2: P.perm) : Pure P.perm
(requires True)
(ensures (fun p ->
((p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm) ==>
p `P.lesser_equal_perm` P.full_perm) /\
p.v == (let open FStar.Real in p1.v *. p2.v)
))
[@@noextract_to "krml"] // proof-only
val typedef (t: Type0) : Type0
inline_for_extraction [@@noextract_to "krml"]
let typeof (#t: Type0) (td: typedef t) : Tot Type0 = t
val fractionable (#t: Type0) (td: typedef t) (x: t) : GTot prop
val mk_fraction (#t: Type0) (td: typedef t) (x: t) (p: P.perm) : Ghost t
(requires (fractionable td x))
(ensures (fun y -> p `P.lesser_equal_perm` P.full_perm ==> fractionable td y))
val mk_fraction_full (#t: Type0) (td: typedef t) (x: t) : Lemma
(requires (fractionable td x))
(ensures (mk_fraction td x P.full_perm == x))
[SMTPat (mk_fraction td x P.full_perm)]
val mk_fraction_compose (#t: Type0) (td: typedef t) (x: t) (p1 p2: P.perm) : Lemma
(requires (fractionable td x /\ p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm))
(ensures (mk_fraction td (mk_fraction td x p1) p2 == mk_fraction td x (p1 `prod_perm` p2)))
val full (#t: Type0) (td: typedef t) (v: t) : GTot prop
val uninitialized (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> full td y /\ fractionable td y))
val unknown (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> fractionable td y))
val full_not_unknown
(#t: Type)
(td: typedef t)
(v: t)
: Lemma
(requires (full td v))
(ensures (~ (v == unknown td)))
[SMTPat (full td v)]
val mk_fraction_unknown (#t: Type0) (td: typedef t) (p: P.perm) : Lemma
(ensures (mk_fraction td (unknown td) p == unknown td))
val mk_fraction_eq_unknown (#t: Type0) (td: typedef t) (v: t) (p: P.perm) : Lemma
(requires (fractionable td v /\ mk_fraction td v p == unknown td))
(ensures (v == unknown td))
// To be extracted as: void*
[@@noextract_to "krml"] // primitive
val void_ptr : Type0
// To be extracted as: NULL
[@@noextract_to "krml"] // primitive
val void_null: void_ptr
// To be extracted as: *t
[@@noextract_to "krml"] // primitive
val ptr_gen ([@@@unused] t: Type) : Type0
[@@noextract_to "krml"] // primitive
val null_gen (t: Type) : Tot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen (#[@@@unused] t: Type) (x: ptr_gen t) : GTot void_ptr
val ghost_ptr_gen_of_void_ptr (x: void_ptr) ([@@@unused] t: Type) : GTot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen_of_void_ptr
(x: void_ptr)
(t: Type)
: Lemma
(ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t) == x)
[SMTPat (ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t))]
val ghost_ptr_gen_of_void_ptr_of_ptr_gen
(#t: Type)
(x: ptr_gen t)
: Lemma
(ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t == x)
[SMTPat (ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t)]
inline_for_extraction [@@noextract_to "krml"] // primitive
let ptr (#t: Type) (td: typedef t) : Tot Type0 = ptr_gen t
inline_for_extraction [@@noextract_to "krml"] // primitive
let null (#t: Type) (td: typedef t) : Tot (ptr td) = null_gen t
inline_for_extraction [@@noextract_to "krml"]
let ref (#t: Type) (td: typedef t) : Tot Type0 = (p: ptr td { ~ (p == null td) })
val pts_to (#t: Type) (#td: typedef t) (r: ref td) ([@@@smt_fallback] v: Ghost.erased t) : vprop
let pts_to_or_null
(#t: Type) (#td: typedef t) (p: ptr td) (v: Ghost.erased t) : vprop
= if FStar.StrongExcludedMiddle.strong_excluded_middle (p == null _)
then emp
else pts_to p v
[@@noextract_to "krml"] // primitive
val is_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STAtomicBase bool false opened Unobservable
(pts_to_or_null p v)
(fun _ -> pts_to_or_null p v)
(True)
(fun res -> res == true <==> p == null _)
let assert_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost unit opened
(pts_to_or_null p v)
(fun _ -> emp)
(p == null _) | false | false | Steel.ST.C.Types.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val assert_null (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (p: ptr td)
: STGhost unit opened (pts_to_or_null p v) (fun _ -> emp) (p == null _) (fun _ -> True) | [] | Steel.ST.C.Types.Base.assert_null | {
"file_name": "lib/steel/c/Steel.ST.C.Types.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p: Steel.ST.C.Types.Base.ptr td -> Steel.ST.Effect.Ghost.STGhost Prims.unit | {
"end_col": 34,
"end_line": 135,
"start_col": 2,
"start_line": 135
} |
Steel.ST.Effect.Ghost.STGhost | val assert_not_null (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (p: ptr td)
: STGhost (squash (~(p == null _)))
opened
(pts_to_or_null p v)
(fun _ -> pts_to p v)
(~(p == null _))
(fun _ -> True) | [
{
"abbrev": true,
"full_module": "Steel.FractionalPermission",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let assert_not_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost (squash (~ (p == null _))) opened
(pts_to_or_null p v)
(fun _ -> pts_to p v)
(~ (p == null _))
(fun _ -> True)
= rewrite (pts_to_or_null p v) (pts_to p v) | val assert_not_null (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (p: ptr td)
: STGhost (squash (~(p == null _)))
opened
(pts_to_or_null p v)
(fun _ -> pts_to p v)
(~(p == null _))
(fun _ -> True)
let assert_not_null (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (p: ptr td)
: STGhost (squash (~(p == null _)))
opened
(pts_to_or_null p v)
(fun _ -> pts_to p v)
(~(p == null _))
(fun _ -> True) = | true | null | true | rewrite (pts_to_or_null p v) (pts_to p v) | {
"checked_file": "Steel.ST.C.Types.Base.fsti.checked",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"prims.fst.checked",
"FStar.StrongExcludedMiddle.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.ST.C.Types.Base.fsti"
} | [] | [
"Steel.Memory.inames",
"Steel.ST.C.Types.Base.typedef",
"FStar.Ghost.erased",
"Steel.ST.C.Types.Base.ptr",
"Steel.ST.Util.rewrite",
"Steel.ST.C.Types.Base.pts_to_or_null",
"Steel.ST.C.Types.Base.pts_to",
"Prims.unit",
"Prims.squash",
"Prims.l_not",
"Prims.eq2",
"Steel.ST.C.Types.Base.null",
"Steel.Effect.Common.vprop",
"Prims.l_True"
] | [] | module Steel.ST.C.Types.Base
open Steel.ST.Util
module P = Steel.FractionalPermission
/// Helper to compose two permissions into one
val prod_perm (p1 p2: P.perm) : Pure P.perm
(requires True)
(ensures (fun p ->
((p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm) ==>
p `P.lesser_equal_perm` P.full_perm) /\
p.v == (let open FStar.Real in p1.v *. p2.v)
))
[@@noextract_to "krml"] // proof-only
val typedef (t: Type0) : Type0
inline_for_extraction [@@noextract_to "krml"]
let typeof (#t: Type0) (td: typedef t) : Tot Type0 = t
val fractionable (#t: Type0) (td: typedef t) (x: t) : GTot prop
val mk_fraction (#t: Type0) (td: typedef t) (x: t) (p: P.perm) : Ghost t
(requires (fractionable td x))
(ensures (fun y -> p `P.lesser_equal_perm` P.full_perm ==> fractionable td y))
val mk_fraction_full (#t: Type0) (td: typedef t) (x: t) : Lemma
(requires (fractionable td x))
(ensures (mk_fraction td x P.full_perm == x))
[SMTPat (mk_fraction td x P.full_perm)]
val mk_fraction_compose (#t: Type0) (td: typedef t) (x: t) (p1 p2: P.perm) : Lemma
(requires (fractionable td x /\ p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm))
(ensures (mk_fraction td (mk_fraction td x p1) p2 == mk_fraction td x (p1 `prod_perm` p2)))
val full (#t: Type0) (td: typedef t) (v: t) : GTot prop
val uninitialized (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> full td y /\ fractionable td y))
val unknown (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> fractionable td y))
val full_not_unknown
(#t: Type)
(td: typedef t)
(v: t)
: Lemma
(requires (full td v))
(ensures (~ (v == unknown td)))
[SMTPat (full td v)]
val mk_fraction_unknown (#t: Type0) (td: typedef t) (p: P.perm) : Lemma
(ensures (mk_fraction td (unknown td) p == unknown td))
val mk_fraction_eq_unknown (#t: Type0) (td: typedef t) (v: t) (p: P.perm) : Lemma
(requires (fractionable td v /\ mk_fraction td v p == unknown td))
(ensures (v == unknown td))
// To be extracted as: void*
[@@noextract_to "krml"] // primitive
val void_ptr : Type0
// To be extracted as: NULL
[@@noextract_to "krml"] // primitive
val void_null: void_ptr
// To be extracted as: *t
[@@noextract_to "krml"] // primitive
val ptr_gen ([@@@unused] t: Type) : Type0
[@@noextract_to "krml"] // primitive
val null_gen (t: Type) : Tot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen (#[@@@unused] t: Type) (x: ptr_gen t) : GTot void_ptr
val ghost_ptr_gen_of_void_ptr (x: void_ptr) ([@@@unused] t: Type) : GTot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen_of_void_ptr
(x: void_ptr)
(t: Type)
: Lemma
(ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t) == x)
[SMTPat (ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t))]
val ghost_ptr_gen_of_void_ptr_of_ptr_gen
(#t: Type)
(x: ptr_gen t)
: Lemma
(ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t == x)
[SMTPat (ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t)]
inline_for_extraction [@@noextract_to "krml"] // primitive
let ptr (#t: Type) (td: typedef t) : Tot Type0 = ptr_gen t
inline_for_extraction [@@noextract_to "krml"] // primitive
let null (#t: Type) (td: typedef t) : Tot (ptr td) = null_gen t
inline_for_extraction [@@noextract_to "krml"]
let ref (#t: Type) (td: typedef t) : Tot Type0 = (p: ptr td { ~ (p == null td) })
val pts_to (#t: Type) (#td: typedef t) (r: ref td) ([@@@smt_fallback] v: Ghost.erased t) : vprop
let pts_to_or_null
(#t: Type) (#td: typedef t) (p: ptr td) (v: Ghost.erased t) : vprop
= if FStar.StrongExcludedMiddle.strong_excluded_middle (p == null _)
then emp
else pts_to p v
[@@noextract_to "krml"] // primitive
val is_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STAtomicBase bool false opened Unobservable
(pts_to_or_null p v)
(fun _ -> pts_to_or_null p v)
(True)
(fun res -> res == true <==> p == null _)
let assert_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost unit opened
(pts_to_or_null p v)
(fun _ -> emp)
(p == null _)
(fun _ -> True)
= rewrite (pts_to_or_null p v) emp
let assert_not_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost (squash (~ (p == null _))) opened
(pts_to_or_null p v)
(fun _ -> pts_to p v)
(~ (p == null _)) | false | false | Steel.ST.C.Types.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val assert_not_null (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (p: ptr td)
: STGhost (squash (~(p == null _)))
opened
(pts_to_or_null p v)
(fun _ -> pts_to p v)
(~(p == null _))
(fun _ -> True) | [] | Steel.ST.C.Types.Base.assert_not_null | {
"file_name": "lib/steel/c/Steel.ST.C.Types.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | p: Steel.ST.C.Types.Base.ptr td
-> Steel.ST.Effect.Ghost.STGhost (Prims.squash (~(p == Steel.ST.C.Types.Base.null td))) | {
"end_col": 43,
"end_line": 148,
"start_col": 2,
"start_line": 148
} |
Steel.ST.Effect.Ghost.STGhost | val mk_fraction_split
(#opened: _)
(#t: Type)
(#td: typedef t)
(r: ref td)
(v: Ghost.erased t {fractionable td v})
(p1 p2: P.perm)
: STGhost unit
opened
(pts_to r v)
(fun _ -> (pts_to r (mk_fraction td v p1)) `star` (pts_to r (mk_fraction td v p2)))
(P.full_perm == p1 `P.sum_perm` p2)
(fun _ -> True) | [
{
"abbrev": true,
"full_module": "Steel.FractionalPermission",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let mk_fraction_split
(#opened: _)
(#t: Type) (#td: typedef t) (r: ref td) (v: Ghost.erased t { fractionable td v }) (p1 p2: P.perm) : STGhost unit opened
(pts_to r v)
(fun _ -> pts_to r (mk_fraction td v p1) `star` pts_to r (mk_fraction td v p2))
(P.full_perm == p1 `P.sum_perm` p2)
(fun _ -> True)
= mk_fraction_full td v;
rewrite (pts_to _ _) (pts_to _ _);
mk_fraction_split_gen r v P.full_perm p1 p2 | val mk_fraction_split
(#opened: _)
(#t: Type)
(#td: typedef t)
(r: ref td)
(v: Ghost.erased t {fractionable td v})
(p1 p2: P.perm)
: STGhost unit
opened
(pts_to r v)
(fun _ -> (pts_to r (mk_fraction td v p1)) `star` (pts_to r (mk_fraction td v p2)))
(P.full_perm == p1 `P.sum_perm` p2)
(fun _ -> True)
let mk_fraction_split
(#opened: _)
(#t: Type)
(#td: typedef t)
(r: ref td)
(v: Ghost.erased t {fractionable td v})
(p1 p2: P.perm)
: STGhost unit
opened
(pts_to r v)
(fun _ -> (pts_to r (mk_fraction td v p1)) `star` (pts_to r (mk_fraction td v p2)))
(P.full_perm == p1 `P.sum_perm` p2)
(fun _ -> True) = | true | null | false | mk_fraction_full td v;
rewrite (pts_to _ _) (pts_to _ _);
mk_fraction_split_gen r v P.full_perm p1 p2 | {
"checked_file": "Steel.ST.C.Types.Base.fsti.checked",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"prims.fst.checked",
"FStar.StrongExcludedMiddle.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.ST.C.Types.Base.fsti"
} | [] | [
"Steel.Memory.inames",
"Steel.ST.C.Types.Base.typedef",
"Steel.ST.C.Types.Base.ref",
"FStar.Ghost.erased",
"Steel.ST.C.Types.Base.fractionable",
"FStar.Ghost.reveal",
"Steel.FractionalPermission.perm",
"Steel.ST.C.Types.Base.mk_fraction_split_gen",
"Steel.FractionalPermission.full_perm",
"Prims.unit",
"Steel.ST.Util.rewrite",
"Steel.ST.C.Types.Base.pts_to",
"FStar.Ghost.hide",
"Steel.ST.C.Types.Base.mk_fraction",
"Steel.ST.C.Types.Base.mk_fraction_full",
"Steel.Effect.Common.star",
"Steel.Effect.Common.vprop",
"Prims.eq2",
"Steel.FractionalPermission.sum_perm",
"Prims.l_True"
] | [] | module Steel.ST.C.Types.Base
open Steel.ST.Util
module P = Steel.FractionalPermission
/// Helper to compose two permissions into one
val prod_perm (p1 p2: P.perm) : Pure P.perm
(requires True)
(ensures (fun p ->
((p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm) ==>
p `P.lesser_equal_perm` P.full_perm) /\
p.v == (let open FStar.Real in p1.v *. p2.v)
))
[@@noextract_to "krml"] // proof-only
val typedef (t: Type0) : Type0
inline_for_extraction [@@noextract_to "krml"]
let typeof (#t: Type0) (td: typedef t) : Tot Type0 = t
val fractionable (#t: Type0) (td: typedef t) (x: t) : GTot prop
val mk_fraction (#t: Type0) (td: typedef t) (x: t) (p: P.perm) : Ghost t
(requires (fractionable td x))
(ensures (fun y -> p `P.lesser_equal_perm` P.full_perm ==> fractionable td y))
val mk_fraction_full (#t: Type0) (td: typedef t) (x: t) : Lemma
(requires (fractionable td x))
(ensures (mk_fraction td x P.full_perm == x))
[SMTPat (mk_fraction td x P.full_perm)]
val mk_fraction_compose (#t: Type0) (td: typedef t) (x: t) (p1 p2: P.perm) : Lemma
(requires (fractionable td x /\ p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm))
(ensures (mk_fraction td (mk_fraction td x p1) p2 == mk_fraction td x (p1 `prod_perm` p2)))
val full (#t: Type0) (td: typedef t) (v: t) : GTot prop
val uninitialized (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> full td y /\ fractionable td y))
val unknown (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> fractionable td y))
val full_not_unknown
(#t: Type)
(td: typedef t)
(v: t)
: Lemma
(requires (full td v))
(ensures (~ (v == unknown td)))
[SMTPat (full td v)]
val mk_fraction_unknown (#t: Type0) (td: typedef t) (p: P.perm) : Lemma
(ensures (mk_fraction td (unknown td) p == unknown td))
val mk_fraction_eq_unknown (#t: Type0) (td: typedef t) (v: t) (p: P.perm) : Lemma
(requires (fractionable td v /\ mk_fraction td v p == unknown td))
(ensures (v == unknown td))
// To be extracted as: void*
[@@noextract_to "krml"] // primitive
val void_ptr : Type0
// To be extracted as: NULL
[@@noextract_to "krml"] // primitive
val void_null: void_ptr
// To be extracted as: *t
[@@noextract_to "krml"] // primitive
val ptr_gen ([@@@unused] t: Type) : Type0
[@@noextract_to "krml"] // primitive
val null_gen (t: Type) : Tot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen (#[@@@unused] t: Type) (x: ptr_gen t) : GTot void_ptr
val ghost_ptr_gen_of_void_ptr (x: void_ptr) ([@@@unused] t: Type) : GTot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen_of_void_ptr
(x: void_ptr)
(t: Type)
: Lemma
(ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t) == x)
[SMTPat (ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t))]
val ghost_ptr_gen_of_void_ptr_of_ptr_gen
(#t: Type)
(x: ptr_gen t)
: Lemma
(ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t == x)
[SMTPat (ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t)]
inline_for_extraction [@@noextract_to "krml"] // primitive
let ptr (#t: Type) (td: typedef t) : Tot Type0 = ptr_gen t
inline_for_extraction [@@noextract_to "krml"] // primitive
let null (#t: Type) (td: typedef t) : Tot (ptr td) = null_gen t
inline_for_extraction [@@noextract_to "krml"]
let ref (#t: Type) (td: typedef t) : Tot Type0 = (p: ptr td { ~ (p == null td) })
val pts_to (#t: Type) (#td: typedef t) (r: ref td) ([@@@smt_fallback] v: Ghost.erased t) : vprop
let pts_to_or_null
(#t: Type) (#td: typedef t) (p: ptr td) (v: Ghost.erased t) : vprop
= if FStar.StrongExcludedMiddle.strong_excluded_middle (p == null _)
then emp
else pts_to p v
[@@noextract_to "krml"] // primitive
val is_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STAtomicBase bool false opened Unobservable
(pts_to_or_null p v)
(fun _ -> pts_to_or_null p v)
(True)
(fun res -> res == true <==> p == null _)
let assert_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost unit opened
(pts_to_or_null p v)
(fun _ -> emp)
(p == null _)
(fun _ -> True)
= rewrite (pts_to_or_null p v) emp
let assert_not_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost (squash (~ (p == null _))) opened
(pts_to_or_null p v)
(fun _ -> pts_to p v)
(~ (p == null _))
(fun _ -> True)
= rewrite (pts_to_or_null p v) (pts_to p v)
[@@noextract_to "krml"] // primitive
val void_ptr_of_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ptr td) : STAtomicBase void_ptr false opened Unobservable
(pts_to_or_null x v)
(fun _ -> pts_to_or_null x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x)
[@@noextract_to "krml"] inline_for_extraction
let void_ptr_of_ref (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ref td) : STAtomicBase void_ptr false opened Unobservable
(pts_to x v)
(fun _ -> pts_to x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x)
= rewrite (pts_to x v) (pts_to_or_null x v);
let res = void_ptr_of_ptr x in
rewrite (pts_to_or_null x v) (pts_to x v);
return res
[@@noextract_to "krml"] // primitive
val ptr_of_void_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: void_ptr) : STAtomicBase (ptr td) false opened Unobservable
(pts_to_or_null (ghost_ptr_gen_of_void_ptr x t <: ptr td) v)
(fun y -> pts_to_or_null y v)
True
(fun y -> y == ghost_ptr_gen_of_void_ptr x t)
[@@noextract_to "krml"] inline_for_extraction
let ref_of_void_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: void_ptr) (y': Ghost.erased (ref td)) : STAtomicBase (ref td) false opened Unobservable
(pts_to y' v)
(fun y -> pts_to y v)
(Ghost.reveal y' == ghost_ptr_gen_of_void_ptr x t)
(fun y -> y == Ghost.reveal y')
= rewrite (pts_to y' v) (pts_to_or_null (ghost_ptr_gen_of_void_ptr x t <: ptr td) v);
let y = ptr_of_void_ptr x in
rewrite (pts_to_or_null y v) (pts_to y v);
return y
val ref_equiv
(#t: Type)
(#td: typedef t)
(r1 r2: ref td)
: Tot vprop
val pts_to_equiv
(#opened: _)
(#t: Type)
(#td: typedef t)
(r1 r2: ref td)
(v: Ghost.erased t)
: STGhostT unit opened
(ref_equiv r1 r2 `star` pts_to r1 v)
(fun _ -> ref_equiv r1 r2 `star` pts_to r2 v)
val freeable
(#t: Type)
(#td: typedef t)
(r: ref td)
: Tot vprop
val freeable_dup
(#opened: _)
(#t: Type)
(#td: typedef t)
(r: ref td)
: STGhostT unit opened
(freeable r)
(fun _ -> freeable r `star` freeable r)
val freeable_equiv
(#opened: _)
(#t: Type)
(#td: typedef t)
(r1 r2: ref td)
: STGhostT unit opened
(ref_equiv r1 r2 `star` freeable r1)
(fun _ -> ref_equiv r1 r2 `star` freeable r2)
let freeable_or_null
(#t: Type)
(#td: typedef t)
(r: ptr td)
: Tot vprop
= if FStar.StrongExcludedMiddle.strong_excluded_middle (r == null _)
then emp
else freeable r
(*
let freeable_or_null_dup
(#opened: _)
(#t: Type)
(#td: typedef t)
(r: ptr td)
: SteelGhostT vprop opened
(freeable_or_null r)
(fun _ -> freeable_or_null r `star` freeable_or_null r)
= if FStar.StrongExcludedMiddle.strong_excluded_middle (r == null _)
then ()
else freeable r
*)
[@@noextract_to "krml"] // primitive
val alloc
(#t: Type)
(td: typedef t)
: STT (ptr td)
emp
(fun p -> pts_to_or_null p (uninitialized td) `star` freeable_or_null p)
[@@noextract_to "krml"] // primitive
val free
(#t: Type)
(#td: typedef t)
(#v: Ghost.erased t)
(r: ref td)
: ST unit
(pts_to r v `star` freeable r)
(fun _ -> emp)
(
full td v
)
(fun _ -> True)
val mk_fraction_split_gen
(#opened: _)
(#t: Type) (#td: typedef t) (r: ref td) (v: t { fractionable td v }) (p p1 p2: P.perm) : STGhost unit opened
(pts_to r (mk_fraction td v p))
(fun _ -> pts_to r (mk_fraction td v p1) `star` pts_to r (mk_fraction td v p2))
(p == p1 `P.sum_perm` p2 /\ p `P.lesser_equal_perm` P.full_perm)
(fun _ -> True)
let mk_fraction_split
(#opened: _)
(#t: Type) (#td: typedef t) (r: ref td) (v: Ghost.erased t { fractionable td v }) (p1 p2: P.perm) : STGhost unit opened
(pts_to r v)
(fun _ -> pts_to r (mk_fraction td v p1) `star` pts_to r (mk_fraction td v p2))
(P.full_perm == p1 `P.sum_perm` p2) | false | false | Steel.ST.C.Types.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val mk_fraction_split
(#opened: _)
(#t: Type)
(#td: typedef t)
(r: ref td)
(v: Ghost.erased t {fractionable td v})
(p1 p2: P.perm)
: STGhost unit
opened
(pts_to r v)
(fun _ -> (pts_to r (mk_fraction td v p1)) `star` (pts_to r (mk_fraction td v p2)))
(P.full_perm == p1 `P.sum_perm` p2)
(fun _ -> True) | [] | Steel.ST.C.Types.Base.mk_fraction_split | {
"file_name": "lib/steel/c/Steel.ST.C.Types.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} |
r: Steel.ST.C.Types.Base.ref td ->
v: FStar.Ghost.erased t {Steel.ST.C.Types.Base.fractionable td (FStar.Ghost.reveal v)} ->
p1: Steel.FractionalPermission.perm ->
p2: Steel.FractionalPermission.perm
-> Steel.ST.Effect.Ghost.STGhost Prims.unit | {
"end_col": 45,
"end_line": 288,
"start_col": 2,
"start_line": 286
} |
Steel.ST.Effect.Atomic.STAtomicBase | val void_ptr_of_ref (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ref td)
: STAtomicBase void_ptr
false
opened
Unobservable
(pts_to x v)
(fun _ -> pts_to x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x) | [
{
"abbrev": true,
"full_module": "Steel.FractionalPermission",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let void_ptr_of_ref (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ref td) : STAtomicBase void_ptr false opened Unobservable
(pts_to x v)
(fun _ -> pts_to x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x)
= rewrite (pts_to x v) (pts_to_or_null x v);
let res = void_ptr_of_ptr x in
rewrite (pts_to_or_null x v) (pts_to x v);
return res | val void_ptr_of_ref (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ref td)
: STAtomicBase void_ptr
false
opened
Unobservable
(pts_to x v)
(fun _ -> pts_to x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x)
let void_ptr_of_ref (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ref td)
: STAtomicBase void_ptr
false
opened
Unobservable
(pts_to x v)
(fun _ -> pts_to x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x) = | true | null | false | rewrite (pts_to x v) (pts_to_or_null x v);
let res = void_ptr_of_ptr x in
rewrite (pts_to_or_null x v) (pts_to x v);
return res | {
"checked_file": "Steel.ST.C.Types.Base.fsti.checked",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"prims.fst.checked",
"FStar.StrongExcludedMiddle.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.ST.C.Types.Base.fsti"
} | [] | [
"Steel.Memory.inames",
"Steel.ST.C.Types.Base.typedef",
"FStar.Ghost.erased",
"Steel.ST.C.Types.Base.ref",
"Steel.ST.Util.return",
"Steel.ST.C.Types.Base.void_ptr",
"Steel.ST.C.Types.Base.pts_to",
"Steel.Effect.Common.vprop",
"Prims.unit",
"Steel.ST.Util.rewrite",
"Steel.ST.C.Types.Base.pts_to_or_null",
"Steel.ST.C.Types.Base.void_ptr_of_ptr",
"Steel.Effect.Common.Unobservable",
"Prims.l_True",
"Prims.eq2",
"Steel.ST.C.Types.Base.ghost_void_ptr_of_ptr_gen"
] | [] | module Steel.ST.C.Types.Base
open Steel.ST.Util
module P = Steel.FractionalPermission
/// Helper to compose two permissions into one
val prod_perm (p1 p2: P.perm) : Pure P.perm
(requires True)
(ensures (fun p ->
((p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm) ==>
p `P.lesser_equal_perm` P.full_perm) /\
p.v == (let open FStar.Real in p1.v *. p2.v)
))
[@@noextract_to "krml"] // proof-only
val typedef (t: Type0) : Type0
inline_for_extraction [@@noextract_to "krml"]
let typeof (#t: Type0) (td: typedef t) : Tot Type0 = t
val fractionable (#t: Type0) (td: typedef t) (x: t) : GTot prop
val mk_fraction (#t: Type0) (td: typedef t) (x: t) (p: P.perm) : Ghost t
(requires (fractionable td x))
(ensures (fun y -> p `P.lesser_equal_perm` P.full_perm ==> fractionable td y))
val mk_fraction_full (#t: Type0) (td: typedef t) (x: t) : Lemma
(requires (fractionable td x))
(ensures (mk_fraction td x P.full_perm == x))
[SMTPat (mk_fraction td x P.full_perm)]
val mk_fraction_compose (#t: Type0) (td: typedef t) (x: t) (p1 p2: P.perm) : Lemma
(requires (fractionable td x /\ p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm))
(ensures (mk_fraction td (mk_fraction td x p1) p2 == mk_fraction td x (p1 `prod_perm` p2)))
val full (#t: Type0) (td: typedef t) (v: t) : GTot prop
val uninitialized (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> full td y /\ fractionable td y))
val unknown (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> fractionable td y))
val full_not_unknown
(#t: Type)
(td: typedef t)
(v: t)
: Lemma
(requires (full td v))
(ensures (~ (v == unknown td)))
[SMTPat (full td v)]
val mk_fraction_unknown (#t: Type0) (td: typedef t) (p: P.perm) : Lemma
(ensures (mk_fraction td (unknown td) p == unknown td))
val mk_fraction_eq_unknown (#t: Type0) (td: typedef t) (v: t) (p: P.perm) : Lemma
(requires (fractionable td v /\ mk_fraction td v p == unknown td))
(ensures (v == unknown td))
// To be extracted as: void*
[@@noextract_to "krml"] // primitive
val void_ptr : Type0
// To be extracted as: NULL
[@@noextract_to "krml"] // primitive
val void_null: void_ptr
// To be extracted as: *t
[@@noextract_to "krml"] // primitive
val ptr_gen ([@@@unused] t: Type) : Type0
[@@noextract_to "krml"] // primitive
val null_gen (t: Type) : Tot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen (#[@@@unused] t: Type) (x: ptr_gen t) : GTot void_ptr
val ghost_ptr_gen_of_void_ptr (x: void_ptr) ([@@@unused] t: Type) : GTot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen_of_void_ptr
(x: void_ptr)
(t: Type)
: Lemma
(ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t) == x)
[SMTPat (ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t))]
val ghost_ptr_gen_of_void_ptr_of_ptr_gen
(#t: Type)
(x: ptr_gen t)
: Lemma
(ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t == x)
[SMTPat (ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t)]
inline_for_extraction [@@noextract_to "krml"] // primitive
let ptr (#t: Type) (td: typedef t) : Tot Type0 = ptr_gen t
inline_for_extraction [@@noextract_to "krml"] // primitive
let null (#t: Type) (td: typedef t) : Tot (ptr td) = null_gen t
inline_for_extraction [@@noextract_to "krml"]
let ref (#t: Type) (td: typedef t) : Tot Type0 = (p: ptr td { ~ (p == null td) })
val pts_to (#t: Type) (#td: typedef t) (r: ref td) ([@@@smt_fallback] v: Ghost.erased t) : vprop
let pts_to_or_null
(#t: Type) (#td: typedef t) (p: ptr td) (v: Ghost.erased t) : vprop
= if FStar.StrongExcludedMiddle.strong_excluded_middle (p == null _)
then emp
else pts_to p v
[@@noextract_to "krml"] // primitive
val is_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STAtomicBase bool false opened Unobservable
(pts_to_or_null p v)
(fun _ -> pts_to_or_null p v)
(True)
(fun res -> res == true <==> p == null _)
let assert_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost unit opened
(pts_to_or_null p v)
(fun _ -> emp)
(p == null _)
(fun _ -> True)
= rewrite (pts_to_or_null p v) emp
let assert_not_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost (squash (~ (p == null _))) opened
(pts_to_or_null p v)
(fun _ -> pts_to p v)
(~ (p == null _))
(fun _ -> True)
= rewrite (pts_to_or_null p v) (pts_to p v)
[@@noextract_to "krml"] // primitive
val void_ptr_of_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ptr td) : STAtomicBase void_ptr false opened Unobservable
(pts_to_or_null x v)
(fun _ -> pts_to_or_null x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x)
[@@noextract_to "krml"] inline_for_extraction
let void_ptr_of_ref (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ref td) : STAtomicBase void_ptr false opened Unobservable
(pts_to x v)
(fun _ -> pts_to x v)
True | false | false | Steel.ST.C.Types.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val void_ptr_of_ref (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ref td)
: STAtomicBase void_ptr
false
opened
Unobservable
(pts_to x v)
(fun _ -> pts_to x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x) | [] | Steel.ST.C.Types.Base.void_ptr_of_ref | {
"file_name": "lib/steel/c/Steel.ST.C.Types.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | x: Steel.ST.C.Types.Base.ref td
-> Steel.ST.Effect.Atomic.STAtomicBase Steel.ST.C.Types.Base.void_ptr | {
"end_col": 12,
"end_line": 166,
"start_col": 2,
"start_line": 163
} |
Steel.ST.Effect.Atomic.STAtomicBase | val ref_of_void_ptr
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(x: void_ptr)
(y': Ghost.erased (ref td))
: STAtomicBase (ref td)
false
opened
Unobservable
(pts_to y' v)
(fun y -> pts_to y v)
(Ghost.reveal y' == ghost_ptr_gen_of_void_ptr x t)
(fun y -> y == Ghost.reveal y') | [
{
"abbrev": true,
"full_module": "Steel.FractionalPermission",
"short_module": "P"
},
{
"abbrev": false,
"full_module": "Steel.ST.Util",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "Steel.ST.C.Types",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let ref_of_void_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: void_ptr) (y': Ghost.erased (ref td)) : STAtomicBase (ref td) false opened Unobservable
(pts_to y' v)
(fun y -> pts_to y v)
(Ghost.reveal y' == ghost_ptr_gen_of_void_ptr x t)
(fun y -> y == Ghost.reveal y')
= rewrite (pts_to y' v) (pts_to_or_null (ghost_ptr_gen_of_void_ptr x t <: ptr td) v);
let y = ptr_of_void_ptr x in
rewrite (pts_to_or_null y v) (pts_to y v);
return y | val ref_of_void_ptr
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(x: void_ptr)
(y': Ghost.erased (ref td))
: STAtomicBase (ref td)
false
opened
Unobservable
(pts_to y' v)
(fun y -> pts_to y v)
(Ghost.reveal y' == ghost_ptr_gen_of_void_ptr x t)
(fun y -> y == Ghost.reveal y')
let ref_of_void_ptr
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(x: void_ptr)
(y': Ghost.erased (ref td))
: STAtomicBase (ref td)
false
opened
Unobservable
(pts_to y' v)
(fun y -> pts_to y v)
(Ghost.reveal y' == ghost_ptr_gen_of_void_ptr x t)
(fun y -> y == Ghost.reveal y') = | true | null | false | rewrite (pts_to y' v) (pts_to_or_null (ghost_ptr_gen_of_void_ptr x t <: ptr td) v);
let y = ptr_of_void_ptr x in
rewrite (pts_to_or_null y v) (pts_to y v);
return y | {
"checked_file": "Steel.ST.C.Types.Base.fsti.checked",
"dependencies": [
"Steel.ST.Util.fsti.checked",
"Steel.FractionalPermission.fst.checked",
"prims.fst.checked",
"FStar.StrongExcludedMiddle.fst.checked",
"FStar.Real.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Ghost.fsti.checked"
],
"interface_file": false,
"source_file": "Steel.ST.C.Types.Base.fsti"
} | [] | [
"Steel.Memory.inames",
"Steel.ST.C.Types.Base.typedef",
"FStar.Ghost.erased",
"Steel.ST.C.Types.Base.void_ptr",
"Steel.ST.C.Types.Base.ref",
"Steel.ST.Util.return",
"Steel.ST.C.Types.Base.pts_to",
"Steel.Effect.Common.vprop",
"Prims.unit",
"Steel.ST.Util.rewrite",
"Steel.ST.C.Types.Base.pts_to_or_null",
"Steel.ST.C.Types.Base.ptr",
"Steel.ST.C.Types.Base.ptr_of_void_ptr",
"FStar.Ghost.reveal",
"Steel.ST.C.Types.Base.ghost_ptr_gen_of_void_ptr",
"Steel.Effect.Common.Unobservable",
"Prims.eq2",
"Steel.ST.C.Types.Base.ptr_gen",
"Prims.l_True"
] | [] | module Steel.ST.C.Types.Base
open Steel.ST.Util
module P = Steel.FractionalPermission
/// Helper to compose two permissions into one
val prod_perm (p1 p2: P.perm) : Pure P.perm
(requires True)
(ensures (fun p ->
((p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm) ==>
p `P.lesser_equal_perm` P.full_perm) /\
p.v == (let open FStar.Real in p1.v *. p2.v)
))
[@@noextract_to "krml"] // proof-only
val typedef (t: Type0) : Type0
inline_for_extraction [@@noextract_to "krml"]
let typeof (#t: Type0) (td: typedef t) : Tot Type0 = t
val fractionable (#t: Type0) (td: typedef t) (x: t) : GTot prop
val mk_fraction (#t: Type0) (td: typedef t) (x: t) (p: P.perm) : Ghost t
(requires (fractionable td x))
(ensures (fun y -> p `P.lesser_equal_perm` P.full_perm ==> fractionable td y))
val mk_fraction_full (#t: Type0) (td: typedef t) (x: t) : Lemma
(requires (fractionable td x))
(ensures (mk_fraction td x P.full_perm == x))
[SMTPat (mk_fraction td x P.full_perm)]
val mk_fraction_compose (#t: Type0) (td: typedef t) (x: t) (p1 p2: P.perm) : Lemma
(requires (fractionable td x /\ p1 `P.lesser_equal_perm` P.full_perm /\ p2 `P.lesser_equal_perm` P.full_perm))
(ensures (mk_fraction td (mk_fraction td x p1) p2 == mk_fraction td x (p1 `prod_perm` p2)))
val full (#t: Type0) (td: typedef t) (v: t) : GTot prop
val uninitialized (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> full td y /\ fractionable td y))
val unknown (#t: Type0) (td: typedef t) : Ghost t
(requires True)
(ensures (fun y -> fractionable td y))
val full_not_unknown
(#t: Type)
(td: typedef t)
(v: t)
: Lemma
(requires (full td v))
(ensures (~ (v == unknown td)))
[SMTPat (full td v)]
val mk_fraction_unknown (#t: Type0) (td: typedef t) (p: P.perm) : Lemma
(ensures (mk_fraction td (unknown td) p == unknown td))
val mk_fraction_eq_unknown (#t: Type0) (td: typedef t) (v: t) (p: P.perm) : Lemma
(requires (fractionable td v /\ mk_fraction td v p == unknown td))
(ensures (v == unknown td))
// To be extracted as: void*
[@@noextract_to "krml"] // primitive
val void_ptr : Type0
// To be extracted as: NULL
[@@noextract_to "krml"] // primitive
val void_null: void_ptr
// To be extracted as: *t
[@@noextract_to "krml"] // primitive
val ptr_gen ([@@@unused] t: Type) : Type0
[@@noextract_to "krml"] // primitive
val null_gen (t: Type) : Tot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen (#[@@@unused] t: Type) (x: ptr_gen t) : GTot void_ptr
val ghost_ptr_gen_of_void_ptr (x: void_ptr) ([@@@unused] t: Type) : GTot (ptr_gen t)
val ghost_void_ptr_of_ptr_gen_of_void_ptr
(x: void_ptr)
(t: Type)
: Lemma
(ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t) == x)
[SMTPat (ghost_void_ptr_of_ptr_gen (ghost_ptr_gen_of_void_ptr x t))]
val ghost_ptr_gen_of_void_ptr_of_ptr_gen
(#t: Type)
(x: ptr_gen t)
: Lemma
(ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t == x)
[SMTPat (ghost_ptr_gen_of_void_ptr (ghost_void_ptr_of_ptr_gen x) t)]
inline_for_extraction [@@noextract_to "krml"] // primitive
let ptr (#t: Type) (td: typedef t) : Tot Type0 = ptr_gen t
inline_for_extraction [@@noextract_to "krml"] // primitive
let null (#t: Type) (td: typedef t) : Tot (ptr td) = null_gen t
inline_for_extraction [@@noextract_to "krml"]
let ref (#t: Type) (td: typedef t) : Tot Type0 = (p: ptr td { ~ (p == null td) })
val pts_to (#t: Type) (#td: typedef t) (r: ref td) ([@@@smt_fallback] v: Ghost.erased t) : vprop
let pts_to_or_null
(#t: Type) (#td: typedef t) (p: ptr td) (v: Ghost.erased t) : vprop
= if FStar.StrongExcludedMiddle.strong_excluded_middle (p == null _)
then emp
else pts_to p v
[@@noextract_to "krml"] // primitive
val is_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STAtomicBase bool false opened Unobservable
(pts_to_or_null p v)
(fun _ -> pts_to_or_null p v)
(True)
(fun res -> res == true <==> p == null _)
let assert_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost unit opened
(pts_to_or_null p v)
(fun _ -> emp)
(p == null _)
(fun _ -> True)
= rewrite (pts_to_or_null p v) emp
let assert_not_null
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(p: ptr td)
: STGhost (squash (~ (p == null _))) opened
(pts_to_or_null p v)
(fun _ -> pts_to p v)
(~ (p == null _))
(fun _ -> True)
= rewrite (pts_to_or_null p v) (pts_to p v)
[@@noextract_to "krml"] // primitive
val void_ptr_of_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ptr td) : STAtomicBase void_ptr false opened Unobservable
(pts_to_or_null x v)
(fun _ -> pts_to_or_null x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x)
[@@noextract_to "krml"] inline_for_extraction
let void_ptr_of_ref (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: ref td) : STAtomicBase void_ptr false opened Unobservable
(pts_to x v)
(fun _ -> pts_to x v)
True
(fun y -> y == ghost_void_ptr_of_ptr_gen x)
= rewrite (pts_to x v) (pts_to_or_null x v);
let res = void_ptr_of_ptr x in
rewrite (pts_to_or_null x v) (pts_to x v);
return res
[@@noextract_to "krml"] // primitive
val ptr_of_void_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: void_ptr) : STAtomicBase (ptr td) false opened Unobservable
(pts_to_or_null (ghost_ptr_gen_of_void_ptr x t <: ptr td) v)
(fun y -> pts_to_or_null y v)
True
(fun y -> y == ghost_ptr_gen_of_void_ptr x t)
[@@noextract_to "krml"] inline_for_extraction
let ref_of_void_ptr (#t: Type) (#opened: _) (#td: typedef t) (#v: Ghost.erased t) (x: void_ptr) (y': Ghost.erased (ref td)) : STAtomicBase (ref td) false opened Unobservable
(pts_to y' v)
(fun y -> pts_to y v)
(Ghost.reveal y' == ghost_ptr_gen_of_void_ptr x t) | false | false | Steel.ST.C.Types.Base.fsti | {
"detail_errors": false,
"detail_hint_replay": false,
"initial_fuel": 2,
"initial_ifuel": 1,
"max_fuel": 8,
"max_ifuel": 2,
"no_plugins": false,
"no_smt": false,
"no_tactics": false,
"quake_hi": 1,
"quake_keep": false,
"quake_lo": 1,
"retry": false,
"reuse_hint_for": null,
"smtencoding_elim_box": false,
"smtencoding_l_arith_repr": "boxwrap",
"smtencoding_nl_arith_repr": "boxwrap",
"smtencoding_valid_elim": false,
"smtencoding_valid_intro": true,
"tcnorm": true,
"trivial_pre_for_unannotated_effectful_fns": true,
"z3cliopt": [],
"z3refresh": false,
"z3rlimit": 5,
"z3rlimit_factor": 1,
"z3seed": 0,
"z3smtopt": [],
"z3version": "4.8.5"
} | null | val ref_of_void_ptr
(#t: Type)
(#opened: _)
(#td: typedef t)
(#v: Ghost.erased t)
(x: void_ptr)
(y': Ghost.erased (ref td))
: STAtomicBase (ref td)
false
opened
Unobservable
(pts_to y' v)
(fun y -> pts_to y v)
(Ghost.reveal y' == ghost_ptr_gen_of_void_ptr x t)
(fun y -> y == Ghost.reveal y') | [] | Steel.ST.C.Types.Base.ref_of_void_ptr | {
"file_name": "lib/steel/c/Steel.ST.C.Types.Base.fsti",
"git_rev": "7fbb54e94dd4f48ff7cb867d3bae6889a635541e",
"git_url": "https://github.com/FStarLang/steel.git",
"project_name": "steel"
} | x: Steel.ST.C.Types.Base.void_ptr -> y': FStar.Ghost.erased (Steel.ST.C.Types.Base.ref td)
-> Steel.ST.Effect.Atomic.STAtomicBase (Steel.ST.C.Types.Base.ref td) | {
"end_col": 10,
"end_line": 184,
"start_col": 2,
"start_line": 181
} |
Prims.Tot | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let op_At_Percent = FStar.Int.op_At_Percent | let op_At_Percent = | false | null | false | FStar.Int.op_At_Percent | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int.op_At_Percent"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64 | false | false | FStar.Int.Cast.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 op_At_Percent : v: Prims.int -> p: Prims.int{p > 0 /\ p % 2 = 0} -> Prims.int | [] | FStar.Int.Cast.op_At_Percent | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | v: Prims.int -> p: Prims.int{p > 0 /\ p % 2 = 0} -> Prims.int | {
"end_col": 43,
"end_line": 27,
"start_col": 20,
"start_line": 27
} |
|
Prims.Tot | val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint8_to_uint64 a = U64.uint_to_t (U8.v a) | val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = | false | null | false | U64.uint_to_t (U8.v a) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt8.t",
"FStar.UInt64.uint_to_t",
"FStar.UInt8.v",
"FStar.UInt64.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"FStar.UInt.size",
"FStar.UInt64.n",
"FStar.UInt8.n",
"FStar.UInt64.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned | false | false | FStar.Int.Cast.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 uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a}) | [] | FStar.Int.Cast.uint8_to_uint64 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt8.t -> b: FStar.UInt64.t{FStar.UInt64.v b = FStar.UInt8.v a} | {
"end_col": 46,
"end_line": 32,
"start_col": 24,
"start_line": 32
} |
Prims.Tot | val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint8_to_uint16 x = U16.uint_to_t (U8.v x) | val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = | false | null | false | U16.uint_to_t (U8.v x) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt8.t",
"FStar.UInt16.uint_to_t",
"FStar.UInt8.v",
"FStar.UInt16.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"FStar.UInt.size",
"FStar.UInt16.n",
"FStar.UInt8.n",
"FStar.UInt16.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x) | false | false | FStar.Int.Cast.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 uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a}) | [] | FStar.Int.Cast.uint8_to_uint16 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt8.t -> b: FStar.UInt16.t{FStar.UInt16.v b = FStar.UInt8.v a} | {
"end_col": 46,
"end_line": 38,
"start_col": 24,
"start_line": 38
} |
Prims.Tot | val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8) | val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = | false | null | false | U8.uint_to_t (U64.v x % pow2 8) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt64.t",
"FStar.UInt8.uint_to_t",
"Prims.op_Modulus",
"FStar.UInt64.v",
"Prims.pow2",
"FStar.UInt8.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt8.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16) | false | false | FStar.Int.Cast.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 uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8}) | [] | FStar.Int.Cast.uint64_to_uint8 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt64.t -> b: FStar.UInt8.t{FStar.UInt8.v b = FStar.UInt64.v a % Prims.pow2 8} | {
"end_col": 55,
"end_line": 65,
"start_col": 24,
"start_line": 65
} |
Prims.Tot | val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint16_to_uint64 x = U64.uint_to_t (U16.v x) | val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = | false | null | false | U64.uint_to_t (U16.v x) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt16.t",
"FStar.UInt64.uint_to_t",
"FStar.UInt16.v",
"FStar.UInt64.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"FStar.UInt.size",
"FStar.UInt64.n",
"FStar.UInt16.n",
"FStar.UInt64.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x) | false | false | FStar.Int.Cast.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 uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a}) | [] | FStar.Int.Cast.uint16_to_uint64 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt16.t -> b: FStar.UInt64.t{FStar.UInt64.v b = FStar.UInt16.v a} | {
"end_col": 48,
"end_line": 41,
"start_col": 25,
"start_line": 41
} |
Prims.Tot | val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64) | val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = | false | null | false | I64.int_to_t (I32.v x @% pow2 64) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int32.t",
"FStar.Int64.int_to_t",
"FStar.Int.Cast.op_At_Percent",
"FStar.Int32.v",
"Prims.pow2",
"FStar.Int64.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"FStar.Int.size",
"FStar.Int64.n",
"FStar.Int32.n",
"FStar.Int64.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8) | false | false | FStar.Int.Cast.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 int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a}) | [] | FStar.Int.Cast.int32_to_int64 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int32.t -> b: FStar.Int64.t{FStar.Int64.v b = FStar.Int32.v a} | {
"end_col": 56,
"end_line": 90,
"start_col": 23,
"start_line": 90
} |
Prims.Tot | val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint16_to_int64 x = I64.int_to_t (U16.v x) | val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = | false | null | false | I64.int_to_t (U16.v x) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt16.t",
"FStar.Int64.int_to_t",
"FStar.UInt16.v",
"FStar.Int64.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"FStar.Int.size",
"FStar.Int64.n",
"FStar.UInt.size",
"FStar.UInt16.n",
"FStar.Int64.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8) | false | false | FStar.Int.Cast.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 uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a}) | [] | FStar.Int.Cast.uint16_to_int64 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt16.t -> b: FStar.Int64.t{FStar.Int64.v b = FStar.UInt16.v a} | {
"end_col": 46,
"end_line": 134,
"start_col": 24,
"start_line": 134
} |
Prims.Tot | val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16) | val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = | false | null | false | U16.uint_to_t (U64.v x % pow2 16) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt64.t",
"FStar.UInt16.uint_to_t",
"Prims.op_Modulus",
"FStar.UInt64.v",
"Prims.pow2",
"FStar.UInt16.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt16.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32) | false | false | FStar.Int.Cast.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 uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16}) | [] | FStar.Int.Cast.uint64_to_uint16 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt64.t -> b: FStar.UInt16.t{FStar.UInt16.v b = FStar.UInt64.v a % Prims.pow2 16} | {
"end_col": 58,
"end_line": 62,
"start_col": 25,
"start_line": 62
} |
Prims.Tot | val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint8_to_uint32 x = U32.uint_to_t (U8.v x) | val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = | false | null | false | U32.uint_to_t (U8.v x) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt8.t",
"FStar.UInt32.uint_to_t",
"FStar.UInt8.v",
"FStar.UInt32.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"FStar.UInt.size",
"FStar.UInt32.n",
"FStar.UInt8.n",
"FStar.UInt32.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a) | false | false | FStar.Int.Cast.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 uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a}) | [] | FStar.Int.Cast.uint8_to_uint32 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt8.t -> b: FStar.UInt32.t{FStar.UInt32.v b = FStar.UInt8.v a} | {
"end_col": 46,
"end_line": 35,
"start_col": 24,
"start_line": 35
} |
Prims.Tot | val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint16_to_uint32 x = U32.uint_to_t (U16.v x) | val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = | false | null | false | U32.uint_to_t (U16.v x) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt16.t",
"FStar.UInt32.uint_to_t",
"FStar.UInt16.v",
"FStar.UInt32.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"FStar.UInt.size",
"FStar.UInt32.n",
"FStar.UInt16.n",
"FStar.UInt32.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x) | false | false | FStar.Int.Cast.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 uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a}) | [] | FStar.Int.Cast.uint16_to_uint32 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt16.t -> b: FStar.UInt32.t{FStar.UInt32.v b = FStar.UInt16.v a} | {
"end_col": 48,
"end_line": 44,
"start_col": 25,
"start_line": 44
} |
Prims.Tot | val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32) | val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = | false | null | false | U32.uint_to_t (U64.v x % pow2 32) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt64.t",
"FStar.UInt32.uint_to_t",
"Prims.op_Modulus",
"FStar.UInt64.v",
"Prims.pow2",
"FStar.UInt32.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt32.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8) | false | false | FStar.Int.Cast.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 uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32}) | [] | FStar.Int.Cast.uint64_to_uint32 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt64.t -> b: FStar.UInt32.t{FStar.UInt32.v b = FStar.UInt64.v a % Prims.pow2 32} | {
"end_col": 58,
"end_line": 59,
"start_col": 25,
"start_line": 59
} |
Prims.Tot | val int32_to_uint32: a:I32.t -> Tot (b:U32.t{U32.v b = I32.v a % pow2 32}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int32_to_uint32 x = U32.uint_to_t (I32.v x % pow2 32) | val int32_to_uint32: a:I32.t -> Tot (b:U32.t{U32.v b = I32.v a % pow2 32})
let int32_to_uint32 x = | false | null | false | U32.uint_to_t (I32.v x % pow2 32) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int32.t",
"FStar.UInt32.uint_to_t",
"Prims.op_Modulus",
"FStar.Int32.v",
"Prims.pow2",
"FStar.UInt32.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt32.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8)
val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = I64.int_to_t (U32.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int32: a:U32.t -> Tot (b:I32.t{I32.v b = (U32.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int32 x = I32.int_to_t (U32.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int16 x = I16.int_to_t (U32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int8 : a:U32.t -> Tot (b:I8.t {I8.v b = (U32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int8 x = I8.int_to_t (U32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int64: a:U64.t -> Tot (b:I64.t{I64.v b = (U64.v a @% pow2 64)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int64 x = I64.int_to_t (U64.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int32: a:U64.t -> Tot (b:I32.t{I32.v b = (U64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int32 x = I32.int_to_t (U64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int16 x = I16.int_to_t (U64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int8 : a:U64.t -> Tot (b:I8.t {I8.v b = (U64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int8 x = I8.int_to_t (U64.v x @% pow2 8)
/// Signed to unsigned
val int8_to_uint64: a:I8.t -> Tot (b:U64.t{U64.v b = I8.v a % pow2 64})
let int8_to_uint64 x = U64.uint_to_t (I8.v x % pow2 64)
val int8_to_uint32: a:I8.t -> Tot (b:U32.t{U32.v b = I8.v a % pow2 32})
let int8_to_uint32 x = U32.uint_to_t (I8.v x % pow2 32)
val int8_to_uint16: a:I8.t -> Tot (b:U16.t{U16.v b = I8.v a % pow2 16})
let int8_to_uint16 x = U16.uint_to_t (I8.v x % pow2 16)
val int8_to_uint8 : a:I8.t -> Tot (b:U8.t {U8.v b = I8.v a % pow2 8})
let int8_to_uint8 x = U8.uint_to_t (I8.v x % pow2 8)
val int16_to_uint64: a:I16.t -> Tot (b:U64.t{U64.v b = I16.v a % pow2 64})
let int16_to_uint64 x = U64.uint_to_t (I16.v x % pow2 64)
val int16_to_uint32: a:I16.t -> Tot (b:U32.t{U32.v b = I16.v a % pow2 32})
let int16_to_uint32 x = U32.uint_to_t (I16.v x % pow2 32)
val int16_to_uint16: a:I16.t -> Tot (b:U16.t{U16.v b = I16.v a % pow2 16})
let int16_to_uint16 x = U16.uint_to_t (I16.v x % pow2 16)
val int16_to_uint8 : a:I16.t -> Tot (b:U8.t {U8.v b = I16.v a % pow2 8})
let int16_to_uint8 x = U8.uint_to_t (I16.v x % pow2 8)
val int32_to_uint64: a:I32.t -> Tot (b:U64.t{U64.v b = I32.v a % pow2 64})
let int32_to_uint64 x = U64.uint_to_t (I32.v x % pow2 64) | false | false | FStar.Int.Cast.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 int32_to_uint32: a:I32.t -> Tot (b:U32.t{U32.v b = I32.v a % pow2 32}) | [] | FStar.Int.Cast.int32_to_uint32 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int32.t -> b: FStar.UInt32.t{FStar.UInt32.v b = FStar.Int32.v a % Prims.pow2 32} | {
"end_col": 57,
"end_line": 217,
"start_col": 24,
"start_line": 217
} |
Prims.Tot | val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint32_to_int64 x = I64.int_to_t (U32.v x) | val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = | false | null | false | I64.int_to_t (U32.v x) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt32.t",
"FStar.Int64.int_to_t",
"FStar.UInt32.v",
"FStar.Int64.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"FStar.Int.size",
"FStar.Int64.n",
"FStar.UInt.size",
"FStar.UInt32.n",
"FStar.Int64.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8) | false | false | FStar.Int.Cast.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 uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a}) | [] | FStar.Int.Cast.uint32_to_int64 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt32.t -> b: FStar.Int64.t{FStar.Int64.v b = FStar.UInt32.v a} | {
"end_col": 46,
"end_line": 150,
"start_col": 24,
"start_line": 150
} |
Prims.Tot | val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8) | val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = | false | null | false | U8.uint_to_t (U16.v x % pow2 8) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt16.t",
"FStar.UInt8.uint_to_t",
"Prims.op_Modulus",
"FStar.UInt16.v",
"Prims.pow2",
"FStar.UInt8.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt8.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x) | false | false | FStar.Int.Cast.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 uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8}) | [] | FStar.Int.Cast.uint16_to_uint8 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt16.t -> b: FStar.UInt8.t{FStar.UInt8.v b = FStar.UInt16.v a % Prims.pow2 8} | {
"end_col": 55,
"end_line": 47,
"start_col": 24,
"start_line": 47
} |
Prims.Tot | val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8) | val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = | false | null | false | U8.uint_to_t (U32.v x % pow2 8) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt32.t",
"FStar.UInt8.uint_to_t",
"Prims.op_Modulus",
"FStar.UInt32.v",
"Prims.pow2",
"FStar.UInt8.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt8.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16) | false | false | FStar.Int.Cast.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 uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8}) | [] | FStar.Int.Cast.uint32_to_uint8 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt32.t -> b: FStar.UInt8.t{FStar.UInt8.v b = FStar.UInt32.v a % Prims.pow2 8} | {
"end_col": 55,
"end_line": 56,
"start_col": 24,
"start_line": 56
} |
Prims.Tot | val int8_to_uint32: a:I8.t -> Tot (b:U32.t{U32.v b = I8.v a % pow2 32}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int8_to_uint32 x = U32.uint_to_t (I8.v x % pow2 32) | val int8_to_uint32: a:I8.t -> Tot (b:U32.t{U32.v b = I8.v a % pow2 32})
let int8_to_uint32 x = | false | null | false | U32.uint_to_t (I8.v x % pow2 32) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int8.t",
"FStar.UInt32.uint_to_t",
"Prims.op_Modulus",
"FStar.Int8.v",
"Prims.pow2",
"FStar.UInt32.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt32.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8)
val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = I64.int_to_t (U32.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int32: a:U32.t -> Tot (b:I32.t{I32.v b = (U32.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int32 x = I32.int_to_t (U32.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int16 x = I16.int_to_t (U32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int8 : a:U32.t -> Tot (b:I8.t {I8.v b = (U32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int8 x = I8.int_to_t (U32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int64: a:U64.t -> Tot (b:I64.t{I64.v b = (U64.v a @% pow2 64)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int64 x = I64.int_to_t (U64.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int32: a:U64.t -> Tot (b:I32.t{I32.v b = (U64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int32 x = I32.int_to_t (U64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int16 x = I16.int_to_t (U64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int8 : a:U64.t -> Tot (b:I8.t {I8.v b = (U64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int8 x = I8.int_to_t (U64.v x @% pow2 8)
/// Signed to unsigned
val int8_to_uint64: a:I8.t -> Tot (b:U64.t{U64.v b = I8.v a % pow2 64})
let int8_to_uint64 x = U64.uint_to_t (I8.v x % pow2 64) | false | false | FStar.Int.Cast.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 int8_to_uint32: a:I8.t -> Tot (b:U32.t{U32.v b = I8.v a % pow2 32}) | [] | FStar.Int.Cast.int8_to_uint32 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int8.t -> b: FStar.UInt32.t{FStar.UInt32.v b = FStar.Int8.v a % Prims.pow2 32} | {
"end_col": 55,
"end_line": 193,
"start_col": 23,
"start_line": 193
} |
Prims.Tot | val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint8_to_int64 x = I64.int_to_t (U8.v x) | val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = | false | null | false | I64.int_to_t (U8.v x) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt8.t",
"FStar.Int64.int_to_t",
"FStar.UInt8.v",
"FStar.Int64.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"Prims.l_or",
"FStar.Int.size",
"FStar.Int64.n",
"FStar.UInt.size",
"FStar.UInt8.n",
"FStar.Int64.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed | false | false | FStar.Int.Cast.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 uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a}) | [] | FStar.Int.Cast.uint8_to_int64 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt8.t -> b: FStar.Int64.t{FStar.Int64.v b = FStar.UInt8.v a} | {
"end_col": 44,
"end_line": 120,
"start_col": 23,
"start_line": 120
} |
Prims.Tot | val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8) | val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
let int32_to_int8 x = | false | null | false | I8.int_to_t (I32.v x @% pow2 8) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int32.t",
"FStar.Int8.int_to_t",
"FStar.Int.Cast.op_At_Percent",
"FStar.Int32.v",
"Prims.pow2",
"FStar.Int8.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.Int8.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)}) | false | false | FStar.Int.Cast.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 int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)}) | [] | FStar.Int.Cast.int32_to_int8 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int32.t -> b: FStar.Int8.t{FStar.Int8.v b = FStar.Int32.v a @% Prims.pow2 8} | {
"end_col": 53,
"end_line": 100,
"start_col": 22,
"start_line": 100
} |
Prims.Tot | val int8_to_uint64: a:I8.t -> Tot (b:U64.t{U64.v b = I8.v a % pow2 64}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int8_to_uint64 x = U64.uint_to_t (I8.v x % pow2 64) | val int8_to_uint64: a:I8.t -> Tot (b:U64.t{U64.v b = I8.v a % pow2 64})
let int8_to_uint64 x = | false | null | false | U64.uint_to_t (I8.v x % pow2 64) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int8.t",
"FStar.UInt64.uint_to_t",
"Prims.op_Modulus",
"FStar.Int8.v",
"Prims.pow2",
"FStar.UInt64.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt64.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8)
val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = I64.int_to_t (U32.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int32: a:U32.t -> Tot (b:I32.t{I32.v b = (U32.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int32 x = I32.int_to_t (U32.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int16 x = I16.int_to_t (U32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int8 : a:U32.t -> Tot (b:I8.t {I8.v b = (U32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int8 x = I8.int_to_t (U32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int64: a:U64.t -> Tot (b:I64.t{I64.v b = (U64.v a @% pow2 64)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int64 x = I64.int_to_t (U64.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int32: a:U64.t -> Tot (b:I32.t{I32.v b = (U64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int32 x = I32.int_to_t (U64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int16 x = I16.int_to_t (U64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int8 : a:U64.t -> Tot (b:I8.t {I8.v b = (U64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int8 x = I8.int_to_t (U64.v x @% pow2 8)
/// Signed to unsigned | false | false | FStar.Int.Cast.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 int8_to_uint64: a:I8.t -> Tot (b:U64.t{U64.v b = I8.v a % pow2 64}) | [] | FStar.Int.Cast.int8_to_uint64 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int8.t -> b: FStar.UInt64.t{FStar.UInt64.v b = FStar.Int8.v a % Prims.pow2 64} | {
"end_col": 55,
"end_line": 190,
"start_col": 23,
"start_line": 190
} |
Prims.Tot | val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint32_to_int16 x = I16.int_to_t (U32.v x @% pow2 16) | val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)})
let uint32_to_int16 x = | false | null | false | I16.int_to_t (U32.v x @% pow2 16) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt32.t",
"FStar.Int16.int_to_t",
"FStar.Int.Cast.op_At_Percent",
"FStar.UInt32.v",
"Prims.pow2",
"FStar.Int16.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.Int16.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8)
val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = I64.int_to_t (U32.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int32: a:U32.t -> Tot (b:I32.t{I32.v b = (U32.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int32 x = I32.int_to_t (U32.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)}) | false | false | FStar.Int.Cast.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 uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)}) | [] | FStar.Int.Cast.uint32_to_int16 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt32.t -> b: FStar.Int16.t{FStar.Int16.v b = FStar.UInt32.v a @% Prims.pow2 16} | {
"end_col": 57,
"end_line": 160,
"start_col": 24,
"start_line": 160
} |
Prims.Tot | val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16) | val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = | false | null | false | U16.uint_to_t (U32.v x % pow2 16) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt32.t",
"FStar.UInt16.uint_to_t",
"Prims.op_Modulus",
"FStar.UInt32.v",
"Prims.pow2",
"FStar.UInt16.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt16.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x) | false | false | FStar.Int.Cast.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 uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16}) | [] | FStar.Int.Cast.uint32_to_uint16 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt32.t -> b: FStar.UInt16.t{FStar.UInt16.v b = FStar.UInt32.v a % Prims.pow2 16} | {
"end_col": 58,
"end_line": 53,
"start_col": 25,
"start_line": 53
} |
Prims.Tot | val int16_to_uint8 : a:I16.t -> Tot (b:U8.t {U8.v b = I16.v a % pow2 8}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int16_to_uint8 x = U8.uint_to_t (I16.v x % pow2 8) | val int16_to_uint8 : a:I16.t -> Tot (b:U8.t {U8.v b = I16.v a % pow2 8})
let int16_to_uint8 x = | false | null | false | U8.uint_to_t (I16.v x % pow2 8) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int16.t",
"FStar.UInt8.uint_to_t",
"Prims.op_Modulus",
"FStar.Int16.v",
"Prims.pow2",
"FStar.UInt8.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt8.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8)
val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = I64.int_to_t (U32.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int32: a:U32.t -> Tot (b:I32.t{I32.v b = (U32.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int32 x = I32.int_to_t (U32.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int16 x = I16.int_to_t (U32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int8 : a:U32.t -> Tot (b:I8.t {I8.v b = (U32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int8 x = I8.int_to_t (U32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int64: a:U64.t -> Tot (b:I64.t{I64.v b = (U64.v a @% pow2 64)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int64 x = I64.int_to_t (U64.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int32: a:U64.t -> Tot (b:I32.t{I32.v b = (U64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int32 x = I32.int_to_t (U64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int16 x = I16.int_to_t (U64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int8 : a:U64.t -> Tot (b:I8.t {I8.v b = (U64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int8 x = I8.int_to_t (U64.v x @% pow2 8)
/// Signed to unsigned
val int8_to_uint64: a:I8.t -> Tot (b:U64.t{U64.v b = I8.v a % pow2 64})
let int8_to_uint64 x = U64.uint_to_t (I8.v x % pow2 64)
val int8_to_uint32: a:I8.t -> Tot (b:U32.t{U32.v b = I8.v a % pow2 32})
let int8_to_uint32 x = U32.uint_to_t (I8.v x % pow2 32)
val int8_to_uint16: a:I8.t -> Tot (b:U16.t{U16.v b = I8.v a % pow2 16})
let int8_to_uint16 x = U16.uint_to_t (I8.v x % pow2 16)
val int8_to_uint8 : a:I8.t -> Tot (b:U8.t {U8.v b = I8.v a % pow2 8})
let int8_to_uint8 x = U8.uint_to_t (I8.v x % pow2 8)
val int16_to_uint64: a:I16.t -> Tot (b:U64.t{U64.v b = I16.v a % pow2 64})
let int16_to_uint64 x = U64.uint_to_t (I16.v x % pow2 64)
val int16_to_uint32: a:I16.t -> Tot (b:U32.t{U32.v b = I16.v a % pow2 32})
let int16_to_uint32 x = U32.uint_to_t (I16.v x % pow2 32)
val int16_to_uint16: a:I16.t -> Tot (b:U16.t{U16.v b = I16.v a % pow2 16})
let int16_to_uint16 x = U16.uint_to_t (I16.v x % pow2 16) | false | false | FStar.Int.Cast.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 int16_to_uint8 : a:I16.t -> Tot (b:U8.t {U8.v b = I16.v a % pow2 8}) | [] | FStar.Int.Cast.int16_to_uint8 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int16.t -> b: FStar.UInt8.t{FStar.UInt8.v b = FStar.Int16.v a % Prims.pow2 8} | {
"end_col": 54,
"end_line": 211,
"start_col": 23,
"start_line": 211
} |
Prims.Tot | val int16_to_uint32: a:I16.t -> Tot (b:U32.t{U32.v b = I16.v a % pow2 32}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int16_to_uint32 x = U32.uint_to_t (I16.v x % pow2 32) | val int16_to_uint32: a:I16.t -> Tot (b:U32.t{U32.v b = I16.v a % pow2 32})
let int16_to_uint32 x = | false | null | false | U32.uint_to_t (I16.v x % pow2 32) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int16.t",
"FStar.UInt32.uint_to_t",
"Prims.op_Modulus",
"FStar.Int16.v",
"Prims.pow2",
"FStar.UInt32.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt32.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8)
val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = I64.int_to_t (U32.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int32: a:U32.t -> Tot (b:I32.t{I32.v b = (U32.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int32 x = I32.int_to_t (U32.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int16 x = I16.int_to_t (U32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int8 : a:U32.t -> Tot (b:I8.t {I8.v b = (U32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int8 x = I8.int_to_t (U32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int64: a:U64.t -> Tot (b:I64.t{I64.v b = (U64.v a @% pow2 64)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int64 x = I64.int_to_t (U64.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int32: a:U64.t -> Tot (b:I32.t{I32.v b = (U64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int32 x = I32.int_to_t (U64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int16 x = I16.int_to_t (U64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int8 : a:U64.t -> Tot (b:I8.t {I8.v b = (U64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int8 x = I8.int_to_t (U64.v x @% pow2 8)
/// Signed to unsigned
val int8_to_uint64: a:I8.t -> Tot (b:U64.t{U64.v b = I8.v a % pow2 64})
let int8_to_uint64 x = U64.uint_to_t (I8.v x % pow2 64)
val int8_to_uint32: a:I8.t -> Tot (b:U32.t{U32.v b = I8.v a % pow2 32})
let int8_to_uint32 x = U32.uint_to_t (I8.v x % pow2 32)
val int8_to_uint16: a:I8.t -> Tot (b:U16.t{U16.v b = I8.v a % pow2 16})
let int8_to_uint16 x = U16.uint_to_t (I8.v x % pow2 16)
val int8_to_uint8 : a:I8.t -> Tot (b:U8.t {U8.v b = I8.v a % pow2 8})
let int8_to_uint8 x = U8.uint_to_t (I8.v x % pow2 8)
val int16_to_uint64: a:I16.t -> Tot (b:U64.t{U64.v b = I16.v a % pow2 64})
let int16_to_uint64 x = U64.uint_to_t (I16.v x % pow2 64) | false | false | FStar.Int.Cast.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 int16_to_uint32: a:I16.t -> Tot (b:U32.t{U32.v b = I16.v a % pow2 32}) | [] | FStar.Int.Cast.int16_to_uint32 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int16.t -> b: FStar.UInt32.t{FStar.UInt32.v b = FStar.Int16.v a % Prims.pow2 32} | {
"end_col": 57,
"end_line": 205,
"start_col": 24,
"start_line": 205
} |
Prims.Tot | val int8_to_uint16: a:I8.t -> Tot (b:U16.t{U16.v b = I8.v a % pow2 16}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int8_to_uint16 x = U16.uint_to_t (I8.v x % pow2 16) | val int8_to_uint16: a:I8.t -> Tot (b:U16.t{U16.v b = I8.v a % pow2 16})
let int8_to_uint16 x = | false | null | false | U16.uint_to_t (I8.v x % pow2 16) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int8.t",
"FStar.UInt16.uint_to_t",
"Prims.op_Modulus",
"FStar.Int8.v",
"Prims.pow2",
"FStar.UInt16.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt16.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8)
val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = I64.int_to_t (U32.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int32: a:U32.t -> Tot (b:I32.t{I32.v b = (U32.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int32 x = I32.int_to_t (U32.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int16 x = I16.int_to_t (U32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int8 : a:U32.t -> Tot (b:I8.t {I8.v b = (U32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int8 x = I8.int_to_t (U32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int64: a:U64.t -> Tot (b:I64.t{I64.v b = (U64.v a @% pow2 64)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int64 x = I64.int_to_t (U64.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int32: a:U64.t -> Tot (b:I32.t{I32.v b = (U64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int32 x = I32.int_to_t (U64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int16 x = I16.int_to_t (U64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int8 : a:U64.t -> Tot (b:I8.t {I8.v b = (U64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int8 x = I8.int_to_t (U64.v x @% pow2 8)
/// Signed to unsigned
val int8_to_uint64: a:I8.t -> Tot (b:U64.t{U64.v b = I8.v a % pow2 64})
let int8_to_uint64 x = U64.uint_to_t (I8.v x % pow2 64)
val int8_to_uint32: a:I8.t -> Tot (b:U32.t{U32.v b = I8.v a % pow2 32})
let int8_to_uint32 x = U32.uint_to_t (I8.v x % pow2 32) | false | false | FStar.Int.Cast.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 int8_to_uint16: a:I8.t -> Tot (b:U16.t{U16.v b = I8.v a % pow2 16}) | [] | FStar.Int.Cast.int8_to_uint16 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int8.t -> b: FStar.UInt16.t{FStar.UInt16.v b = FStar.Int8.v a % Prims.pow2 16} | {
"end_col": 55,
"end_line": 196,
"start_col": 23,
"start_line": 196
} |
Prims.Tot | val int16_to_uint64: a:I16.t -> Tot (b:U64.t{U64.v b = I16.v a % pow2 64}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int16_to_uint64 x = U64.uint_to_t (I16.v x % pow2 64) | val int16_to_uint64: a:I16.t -> Tot (b:U64.t{U64.v b = I16.v a % pow2 64})
let int16_to_uint64 x = | false | null | false | U64.uint_to_t (I16.v x % pow2 64) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int16.t",
"FStar.UInt64.uint_to_t",
"Prims.op_Modulus",
"FStar.Int16.v",
"Prims.pow2",
"FStar.UInt64.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt64.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8)
val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = I64.int_to_t (U32.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int32: a:U32.t -> Tot (b:I32.t{I32.v b = (U32.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int32 x = I32.int_to_t (U32.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int16 x = I16.int_to_t (U32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int8 : a:U32.t -> Tot (b:I8.t {I8.v b = (U32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int8 x = I8.int_to_t (U32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int64: a:U64.t -> Tot (b:I64.t{I64.v b = (U64.v a @% pow2 64)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int64 x = I64.int_to_t (U64.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int32: a:U64.t -> Tot (b:I32.t{I32.v b = (U64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int32 x = I32.int_to_t (U64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int16 x = I16.int_to_t (U64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int8 : a:U64.t -> Tot (b:I8.t {I8.v b = (U64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int8 x = I8.int_to_t (U64.v x @% pow2 8)
/// Signed to unsigned
val int8_to_uint64: a:I8.t -> Tot (b:U64.t{U64.v b = I8.v a % pow2 64})
let int8_to_uint64 x = U64.uint_to_t (I8.v x % pow2 64)
val int8_to_uint32: a:I8.t -> Tot (b:U32.t{U32.v b = I8.v a % pow2 32})
let int8_to_uint32 x = U32.uint_to_t (I8.v x % pow2 32)
val int8_to_uint16: a:I8.t -> Tot (b:U16.t{U16.v b = I8.v a % pow2 16})
let int8_to_uint16 x = U16.uint_to_t (I8.v x % pow2 16)
val int8_to_uint8 : a:I8.t -> Tot (b:U8.t {U8.v b = I8.v a % pow2 8})
let int8_to_uint8 x = U8.uint_to_t (I8.v x % pow2 8) | false | false | FStar.Int.Cast.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 int16_to_uint64: a:I16.t -> Tot (b:U64.t{U64.v b = I16.v a % pow2 64}) | [] | FStar.Int.Cast.int16_to_uint64 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int16.t -> b: FStar.UInt64.t{FStar.UInt64.v b = FStar.Int16.v a % Prims.pow2 64} | {
"end_col": 57,
"end_line": 202,
"start_col": 24,
"start_line": 202
} |
Prims.Tot | val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32) | val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
let int64_to_int32 x = | false | null | false | I32.int_to_t (I64.v x @% pow2 32) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int64.t",
"FStar.Int32.int_to_t",
"FStar.Int.Cast.op_At_Percent",
"FStar.Int64.v",
"Prims.pow2",
"FStar.Int32.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.Int32.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)}) | false | false | FStar.Int.Cast.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 int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)}) | [] | FStar.Int.Cast.int64_to_int32 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int64.t -> b: FStar.Int32.t{FStar.Int32.v b = FStar.Int64.v a @% Prims.pow2 32} | {
"end_col": 56,
"end_line": 105,
"start_col": 23,
"start_line": 105
} |
Prims.Tot | val int32_to_uint64: a:I32.t -> Tot (b:U64.t{U64.v b = I32.v a % pow2 64}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int32_to_uint64 x = U64.uint_to_t (I32.v x % pow2 64) | val int32_to_uint64: a:I32.t -> Tot (b:U64.t{U64.v b = I32.v a % pow2 64})
let int32_to_uint64 x = | false | null | false | U64.uint_to_t (I32.v x % pow2 64) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int32.t",
"FStar.UInt64.uint_to_t",
"Prims.op_Modulus",
"FStar.Int32.v",
"Prims.pow2",
"FStar.UInt64.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt64.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8)
val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = I64.int_to_t (U32.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int32: a:U32.t -> Tot (b:I32.t{I32.v b = (U32.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int32 x = I32.int_to_t (U32.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int16 x = I16.int_to_t (U32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int8 : a:U32.t -> Tot (b:I8.t {I8.v b = (U32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int8 x = I8.int_to_t (U32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int64: a:U64.t -> Tot (b:I64.t{I64.v b = (U64.v a @% pow2 64)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int64 x = I64.int_to_t (U64.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int32: a:U64.t -> Tot (b:I32.t{I32.v b = (U64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int32 x = I32.int_to_t (U64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int16 x = I16.int_to_t (U64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int8 : a:U64.t -> Tot (b:I8.t {I8.v b = (U64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int8 x = I8.int_to_t (U64.v x @% pow2 8)
/// Signed to unsigned
val int8_to_uint64: a:I8.t -> Tot (b:U64.t{U64.v b = I8.v a % pow2 64})
let int8_to_uint64 x = U64.uint_to_t (I8.v x % pow2 64)
val int8_to_uint32: a:I8.t -> Tot (b:U32.t{U32.v b = I8.v a % pow2 32})
let int8_to_uint32 x = U32.uint_to_t (I8.v x % pow2 32)
val int8_to_uint16: a:I8.t -> Tot (b:U16.t{U16.v b = I8.v a % pow2 16})
let int8_to_uint16 x = U16.uint_to_t (I8.v x % pow2 16)
val int8_to_uint8 : a:I8.t -> Tot (b:U8.t {U8.v b = I8.v a % pow2 8})
let int8_to_uint8 x = U8.uint_to_t (I8.v x % pow2 8)
val int16_to_uint64: a:I16.t -> Tot (b:U64.t{U64.v b = I16.v a % pow2 64})
let int16_to_uint64 x = U64.uint_to_t (I16.v x % pow2 64)
val int16_to_uint32: a:I16.t -> Tot (b:U32.t{U32.v b = I16.v a % pow2 32})
let int16_to_uint32 x = U32.uint_to_t (I16.v x % pow2 32)
val int16_to_uint16: a:I16.t -> Tot (b:U16.t{U16.v b = I16.v a % pow2 16})
let int16_to_uint16 x = U16.uint_to_t (I16.v x % pow2 16)
val int16_to_uint8 : a:I16.t -> Tot (b:U8.t {U8.v b = I16.v a % pow2 8})
let int16_to_uint8 x = U8.uint_to_t (I16.v x % pow2 8) | false | false | FStar.Int.Cast.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 int32_to_uint64: a:I32.t -> Tot (b:U64.t{U64.v b = I32.v a % pow2 64}) | [] | FStar.Int.Cast.int32_to_uint64 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int32.t -> b: FStar.UInt64.t{FStar.UInt64.v b = FStar.Int32.v a % Prims.pow2 64} | {
"end_col": 57,
"end_line": 214,
"start_col": 24,
"start_line": 214
} |
Prims.Tot | val int64_to_uint64: a:I64.t -> Tot (b:U64.t{U64.v b = I64.v a % pow2 64}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int64_to_uint64 x = U64.uint_to_t (I64.v x % pow2 64) | val int64_to_uint64: a:I64.t -> Tot (b:U64.t{U64.v b = I64.v a % pow2 64})
let int64_to_uint64 x = | false | null | false | U64.uint_to_t (I64.v x % pow2 64) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int64.t",
"FStar.UInt64.uint_to_t",
"Prims.op_Modulus",
"FStar.Int64.v",
"Prims.pow2",
"FStar.UInt64.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt64.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8)
val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = I64.int_to_t (U32.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int32: a:U32.t -> Tot (b:I32.t{I32.v b = (U32.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int32 x = I32.int_to_t (U32.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int16 x = I16.int_to_t (U32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int8 : a:U32.t -> Tot (b:I8.t {I8.v b = (U32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int8 x = I8.int_to_t (U32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int64: a:U64.t -> Tot (b:I64.t{I64.v b = (U64.v a @% pow2 64)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int64 x = I64.int_to_t (U64.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int32: a:U64.t -> Tot (b:I32.t{I32.v b = (U64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int32 x = I32.int_to_t (U64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int16 x = I16.int_to_t (U64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int8 : a:U64.t -> Tot (b:I8.t {I8.v b = (U64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int8 x = I8.int_to_t (U64.v x @% pow2 8)
/// Signed to unsigned
val int8_to_uint64: a:I8.t -> Tot (b:U64.t{U64.v b = I8.v a % pow2 64})
let int8_to_uint64 x = U64.uint_to_t (I8.v x % pow2 64)
val int8_to_uint32: a:I8.t -> Tot (b:U32.t{U32.v b = I8.v a % pow2 32})
let int8_to_uint32 x = U32.uint_to_t (I8.v x % pow2 32)
val int8_to_uint16: a:I8.t -> Tot (b:U16.t{U16.v b = I8.v a % pow2 16})
let int8_to_uint16 x = U16.uint_to_t (I8.v x % pow2 16)
val int8_to_uint8 : a:I8.t -> Tot (b:U8.t {U8.v b = I8.v a % pow2 8})
let int8_to_uint8 x = U8.uint_to_t (I8.v x % pow2 8)
val int16_to_uint64: a:I16.t -> Tot (b:U64.t{U64.v b = I16.v a % pow2 64})
let int16_to_uint64 x = U64.uint_to_t (I16.v x % pow2 64)
val int16_to_uint32: a:I16.t -> Tot (b:U32.t{U32.v b = I16.v a % pow2 32})
let int16_to_uint32 x = U32.uint_to_t (I16.v x % pow2 32)
val int16_to_uint16: a:I16.t -> Tot (b:U16.t{U16.v b = I16.v a % pow2 16})
let int16_to_uint16 x = U16.uint_to_t (I16.v x % pow2 16)
val int16_to_uint8 : a:I16.t -> Tot (b:U8.t {U8.v b = I16.v a % pow2 8})
let int16_to_uint8 x = U8.uint_to_t (I16.v x % pow2 8)
val int32_to_uint64: a:I32.t -> Tot (b:U64.t{U64.v b = I32.v a % pow2 64})
let int32_to_uint64 x = U64.uint_to_t (I32.v x % pow2 64)
val int32_to_uint32: a:I32.t -> Tot (b:U32.t{U32.v b = I32.v a % pow2 32})
let int32_to_uint32 x = U32.uint_to_t (I32.v x % pow2 32)
val int32_to_uint16: a:I32.t -> Tot (b:U16.t{U16.v b = I32.v a % pow2 16})
let int32_to_uint16 x = U16.uint_to_t (I32.v x % pow2 16)
val int32_to_uint8 : a:I32.t -> Tot (b:U8.t {U8.v b = I32.v a % pow2 8})
let int32_to_uint8 x = U8.uint_to_t (I32.v x % pow2 8) | false | false | FStar.Int.Cast.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 int64_to_uint64: a:I64.t -> Tot (b:U64.t{U64.v b = I64.v a % pow2 64}) | [] | FStar.Int.Cast.int64_to_uint64 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int64.t -> b: FStar.UInt64.t{FStar.UInt64.v b = FStar.Int64.v a % Prims.pow2 64} | {
"end_col": 57,
"end_line": 226,
"start_col": 24,
"start_line": 226
} |
Prims.Tot | val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8) | val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
let int64_to_int8 x = | false | null | false | I8.int_to_t (I64.v x @% pow2 8) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int64.t",
"FStar.Int8.int_to_t",
"FStar.Int.Cast.op_At_Percent",
"FStar.Int64.v",
"Prims.pow2",
"FStar.Int8.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.Int8.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)}) | false | false | FStar.Int.Cast.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 int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)}) | [] | FStar.Int.Cast.int64_to_int8 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int64.t -> b: FStar.Int8.t{FStar.Int8.v b = FStar.Int64.v a @% Prims.pow2 8} | {
"end_col": 53,
"end_line": 115,
"start_col": 22,
"start_line": 115
} |
Prims.Tot | val int32_to_uint8 : a:I32.t -> Tot (b:U8.t {U8.v b = I32.v a % pow2 8}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int32_to_uint8 x = U8.uint_to_t (I32.v x % pow2 8) | val int32_to_uint8 : a:I32.t -> Tot (b:U8.t {U8.v b = I32.v a % pow2 8})
let int32_to_uint8 x = | false | null | false | U8.uint_to_t (I32.v x % pow2 8) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int32.t",
"FStar.UInt8.uint_to_t",
"Prims.op_Modulus",
"FStar.Int32.v",
"Prims.pow2",
"FStar.UInt8.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt8.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8)
val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = I64.int_to_t (U32.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int32: a:U32.t -> Tot (b:I32.t{I32.v b = (U32.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int32 x = I32.int_to_t (U32.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int16 x = I16.int_to_t (U32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int8 : a:U32.t -> Tot (b:I8.t {I8.v b = (U32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int8 x = I8.int_to_t (U32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int64: a:U64.t -> Tot (b:I64.t{I64.v b = (U64.v a @% pow2 64)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int64 x = I64.int_to_t (U64.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int32: a:U64.t -> Tot (b:I32.t{I32.v b = (U64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int32 x = I32.int_to_t (U64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int16 x = I16.int_to_t (U64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int8 : a:U64.t -> Tot (b:I8.t {I8.v b = (U64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int8 x = I8.int_to_t (U64.v x @% pow2 8)
/// Signed to unsigned
val int8_to_uint64: a:I8.t -> Tot (b:U64.t{U64.v b = I8.v a % pow2 64})
let int8_to_uint64 x = U64.uint_to_t (I8.v x % pow2 64)
val int8_to_uint32: a:I8.t -> Tot (b:U32.t{U32.v b = I8.v a % pow2 32})
let int8_to_uint32 x = U32.uint_to_t (I8.v x % pow2 32)
val int8_to_uint16: a:I8.t -> Tot (b:U16.t{U16.v b = I8.v a % pow2 16})
let int8_to_uint16 x = U16.uint_to_t (I8.v x % pow2 16)
val int8_to_uint8 : a:I8.t -> Tot (b:U8.t {U8.v b = I8.v a % pow2 8})
let int8_to_uint8 x = U8.uint_to_t (I8.v x % pow2 8)
val int16_to_uint64: a:I16.t -> Tot (b:U64.t{U64.v b = I16.v a % pow2 64})
let int16_to_uint64 x = U64.uint_to_t (I16.v x % pow2 64)
val int16_to_uint32: a:I16.t -> Tot (b:U32.t{U32.v b = I16.v a % pow2 32})
let int16_to_uint32 x = U32.uint_to_t (I16.v x % pow2 32)
val int16_to_uint16: a:I16.t -> Tot (b:U16.t{U16.v b = I16.v a % pow2 16})
let int16_to_uint16 x = U16.uint_to_t (I16.v x % pow2 16)
val int16_to_uint8 : a:I16.t -> Tot (b:U8.t {U8.v b = I16.v a % pow2 8})
let int16_to_uint8 x = U8.uint_to_t (I16.v x % pow2 8)
val int32_to_uint64: a:I32.t -> Tot (b:U64.t{U64.v b = I32.v a % pow2 64})
let int32_to_uint64 x = U64.uint_to_t (I32.v x % pow2 64)
val int32_to_uint32: a:I32.t -> Tot (b:U32.t{U32.v b = I32.v a % pow2 32})
let int32_to_uint32 x = U32.uint_to_t (I32.v x % pow2 32)
val int32_to_uint16: a:I32.t -> Tot (b:U16.t{U16.v b = I32.v a % pow2 16})
let int32_to_uint16 x = U16.uint_to_t (I32.v x % pow2 16) | false | false | FStar.Int.Cast.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 int32_to_uint8 : a:I32.t -> Tot (b:U8.t {U8.v b = I32.v a % pow2 8}) | [] | FStar.Int.Cast.int32_to_uint8 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int32.t -> b: FStar.UInt8.t{FStar.UInt8.v b = FStar.Int32.v a % Prims.pow2 8} | {
"end_col": 54,
"end_line": 223,
"start_col": 23,
"start_line": 223
} |
Prims.Tot | val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8) | val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
let uint8_to_int8 x = | false | null | false | I8.int_to_t (U8.v x @% pow2 8) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt8.t",
"FStar.Int8.int_to_t",
"FStar.Int.Cast.op_At_Percent",
"FStar.UInt8.v",
"Prims.pow2",
"FStar.Int8.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.Int8.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)}) | false | false | FStar.Int.Cast.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 uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)}) | [] | FStar.Int.Cast.uint8_to_int8 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt8.t -> b: FStar.Int8.t{FStar.Int8.v b = FStar.UInt8.v a @% Prims.pow2 8} | {
"end_col": 52,
"end_line": 131,
"start_col": 22,
"start_line": 131
} |
Prims.Tot | val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let uint64_to_int16 x = I16.int_to_t (U64.v x @% pow2 16) | val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)})
let uint64_to_int16 x = | false | null | false | I16.int_to_t (U64.v x @% pow2 16) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.UInt64.t",
"FStar.Int16.int_to_t",
"FStar.Int.Cast.op_At_Percent",
"FStar.UInt64.v",
"Prims.pow2",
"FStar.Int16.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.Int16.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8)
val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = I64.int_to_t (U32.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int32: a:U32.t -> Tot (b:I32.t{I32.v b = (U32.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int32 x = I32.int_to_t (U32.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int16 x = I16.int_to_t (U32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int8 : a:U32.t -> Tot (b:I8.t {I8.v b = (U32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int8 x = I8.int_to_t (U32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int64: a:U64.t -> Tot (b:I64.t{I64.v b = (U64.v a @% pow2 64)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int64 x = I64.int_to_t (U64.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int32: a:U64.t -> Tot (b:I32.t{I32.v b = (U64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int32 x = I32.int_to_t (U64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)}) | false | false | FStar.Int.Cast.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 uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)}) | [] | FStar.Int.Cast.uint64_to_int16 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.UInt64.t -> b: FStar.Int16.t{FStar.Int16.v b = FStar.UInt64.v a @% Prims.pow2 16} | {
"end_col": 57,
"end_line": 180,
"start_col": 24,
"start_line": 180
} |
Prims.Tot | val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16) | val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
let int32_to_int16 x = | false | null | false | I16.int_to_t (I32.v x @% pow2 16) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int32.t",
"FStar.Int16.int_to_t",
"FStar.Int.Cast.op_At_Percent",
"FStar.Int32.v",
"Prims.pow2",
"FStar.Int16.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.Int16.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)}) | false | false | FStar.Int.Cast.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 int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)}) | [] | FStar.Int.Cast.int32_to_int16 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int32.t -> b: FStar.Int16.t{FStar.Int16.v b = FStar.Int32.v a @% Prims.pow2 16} | {
"end_col": 56,
"end_line": 95,
"start_col": 23,
"start_line": 95
} |
Prims.Tot | val int32_to_uint16: a:I32.t -> Tot (b:U16.t{U16.v b = I32.v a % pow2 16}) | [
{
"abbrev": true,
"full_module": "FStar.Int64",
"short_module": "I64"
},
{
"abbrev": true,
"full_module": "FStar.Int32",
"short_module": "I32"
},
{
"abbrev": true,
"full_module": "FStar.Int16",
"short_module": "I16"
},
{
"abbrev": true,
"full_module": "FStar.Int8",
"short_module": "I8"
},
{
"abbrev": true,
"full_module": "FStar.UInt64",
"short_module": "U64"
},
{
"abbrev": true,
"full_module": "FStar.UInt32",
"short_module": "U32"
},
{
"abbrev": true,
"full_module": "FStar.UInt16",
"short_module": "U16"
},
{
"abbrev": true,
"full_module": "FStar.UInt8",
"short_module": "U8"
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Int",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar.Pervasives",
"short_module": null
},
{
"abbrev": false,
"full_module": "Prims",
"short_module": null
},
{
"abbrev": false,
"full_module": "FStar",
"short_module": null
}
] | false | let int32_to_uint16 x = U16.uint_to_t (I32.v x % pow2 16) | val int32_to_uint16: a:I32.t -> Tot (b:U16.t{U16.v b = I32.v a % pow2 16})
let int32_to_uint16 x = | false | null | false | U16.uint_to_t (I32.v x % pow2 16) | {
"checked_file": "FStar.Int.Cast.fst.checked",
"dependencies": [
"prims.fst.checked",
"FStar.UInt8.fsti.checked",
"FStar.UInt64.fsti.checked",
"FStar.UInt32.fsti.checked",
"FStar.UInt16.fsti.checked",
"FStar.Pervasives.fsti.checked",
"FStar.Int8.fsti.checked",
"FStar.Int64.fsti.checked",
"FStar.Int32.fsti.checked",
"FStar.Int16.fsti.checked",
"FStar.Int.fsti.checked"
],
"interface_file": false,
"source_file": "FStar.Int.Cast.fst"
} | [
"total"
] | [
"FStar.Int32.t",
"FStar.UInt16.uint_to_t",
"Prims.op_Modulus",
"FStar.Int32.v",
"Prims.pow2",
"FStar.UInt16.t",
"Prims.b2t",
"Prims.op_Equality",
"Prims.int",
"FStar.UInt16.v"
] | [] | (*
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.Int.Cast
module U8 = FStar.UInt8
module U16 = FStar.UInt16
module U32 = FStar.UInt32
module U64 = FStar.UInt64
module I8 = FStar.Int8
module I16 = FStar.Int16
module I32 = FStar.Int32
module I64 = FStar.Int64
let op_At_Percent = FStar.Int.op_At_Percent
/// Unsigned to unsigned
val uint8_to_uint64: a:U8.t -> Tot (b:U64.t{U64.v b = U8.v a})
let uint8_to_uint64 a = U64.uint_to_t (U8.v a)
val uint8_to_uint32: a:U8.t -> Tot (b:U32.t{U32.v b = U8.v a})
let uint8_to_uint32 x = U32.uint_to_t (U8.v x)
val uint8_to_uint16: a:U8.t -> Tot (b:U16.t{U16.v b = U8.v a})
let uint8_to_uint16 x = U16.uint_to_t (U8.v x)
val uint16_to_uint64: a:U16.t -> Tot (b:U64.t{U64.v b = U16.v a})
let uint16_to_uint64 x = U64.uint_to_t (U16.v x)
val uint16_to_uint32: a:U16.t -> Tot (b:U32.t{U32.v b = U16.v a})
let uint16_to_uint32 x = U32.uint_to_t (U16.v x)
val uint16_to_uint8 : a:U16.t -> Tot (b:U8.t{U8.v b = U16.v a % pow2 8})
let uint16_to_uint8 x = U8.uint_to_t (U16.v x % pow2 8)
val uint32_to_uint64: a:U32.t -> Tot (b:U64.t{U64.v b = U32.v a})
let uint32_to_uint64 x = U64.uint_to_t (U32.v x)
val uint32_to_uint16: a:U32.t -> Tot (b:U16.t{U16.v b = U32.v a % pow2 16})
let uint32_to_uint16 x = U16.uint_to_t (U32.v x % pow2 16)
val uint32_to_uint8 : a:U32.t -> Tot (b:U8.t{U8.v b = U32.v a % pow2 8})
let uint32_to_uint8 x = U8.uint_to_t (U32.v x % pow2 8)
val uint64_to_uint32: a:U64.t -> Tot (b:U32.t{U32.v b = U64.v a % pow2 32})
let uint64_to_uint32 x = U32.uint_to_t (U64.v x % pow2 32)
val uint64_to_uint16: a:U64.t -> Tot (b:U16.t{U16.v b = U64.v a % pow2 16})
let uint64_to_uint16 x = U16.uint_to_t (U64.v x % pow2 16)
val uint64_to_uint8 : a:U64.t -> Tot (b:U8.t{U8.v b = U64.v a % pow2 8})
let uint64_to_uint8 x = U8.uint_to_t (U64.v x % pow2 8)
/// Signed to signed
val int8_to_int64: a:I8.t -> Tot (b:I64.t{I64.v b = I8.v a})
let int8_to_int64 x = I64.int_to_t (I8.v x)
val int8_to_int32: a:I8.t -> Tot (b:I32.t{I32.v b = I8.v a})
let int8_to_int32 x = I32.int_to_t (I8.v x)
val int8_to_int16: a:I8.t -> Tot (b:I16.t{I16.v b = I8.v a})
let int8_to_int16 x = I16.int_to_t (I8.v x)
val int16_to_int64: a:I16.t -> Tot (b:I64.t{I64.v b = I16.v a})
let int16_to_int64 x = I64.int_to_t (I16.v x @% pow2 64)
val int16_to_int32: a:I16.t -> Tot (b:I32.t{I32.v b = I16.v a})
let int16_to_int32 x = I32.int_to_t (I16.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int16_to_int8 : a:I16.t -> Tot (b:I8.t {I8.v b = (I16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int16_to_int8 x = I8.int_to_t (I16.v x @% pow2 8)
val int32_to_int64: a:I32.t -> Tot (b:I64.t{I64.v b = I32.v a})
let int32_to_int64 x = I64.int_to_t (I32.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int16: a:I32.t -> Tot (b:I16.t{I16.v b = (I32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int16 x = I16.int_to_t (I32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int32_to_int8 : a:I32.t -> Tot (b:I8.t {I8.v b = (I32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int32_to_int8 x = I8.int_to_t (I32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int32: a:I64.t -> Tot (b:I32.t{I32.v b = (I64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int32 x = I32.int_to_t (I64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int16: a:I64.t -> Tot (b:I16.t{I16.v b = (I64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int16 x = I16.int_to_t (I64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val int64_to_int8 : a:I64.t -> Tot (b:I8.t {I8.v b = (I64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let int64_to_int8 x = I8.int_to_t (I64.v x @% pow2 8)
/// Unsigned to signed
val uint8_to_int64: a:U8.t -> Tot (b:I64.t{I64.v b = U8.v a})
let uint8_to_int64 x = I64.int_to_t (U8.v x)
val uint8_to_int32: a:U8.t -> Tot (b:I32.t{I32.v b = U8.v a})
let uint8_to_int32 x = I32.int_to_t (U8.v x)
val uint8_to_int16: a:U8.t -> Tot (b:I16.t{I16.v b = U8.v a})
let uint8_to_int16 x = I16.int_to_t (U8.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint8_to_int8 : a:U8.t -> Tot (b:I8.t {I8.v b = (U8.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint8_to_int8 x = I8.int_to_t (U8.v x @% pow2 8)
val uint16_to_int64: a:U16.t -> Tot (b:I64.t{I64.v b = U16.v a})
let uint16_to_int64 x = I64.int_to_t (U16.v x)
val uint16_to_int32: a:U16.t -> Tot (b:I32.t{I32.v b = U16.v a})
let uint16_to_int32 x = I32.int_to_t (U16.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int16: a:U16.t -> Tot (b:I16.t{I16.v b = (U16.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int16 x = I16.int_to_t (U16.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint16_to_int8 : a:U16.t -> Tot (b:I8.t {I8.v b = (U16.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint16_to_int8 x = I8.int_to_t (U16.v x @% pow2 8)
val uint32_to_int64: a:U32.t -> Tot (b:I64.t{I64.v b = U32.v a})
let uint32_to_int64 x = I64.int_to_t (U32.v x)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int32: a:U32.t -> Tot (b:I32.t{I32.v b = (U32.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int32 x = I32.int_to_t (U32.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int16: a:U32.t -> Tot (b:I16.t{I16.v b = (U32.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int16 x = I16.int_to_t (U32.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint32_to_int8 : a:U32.t -> Tot (b:I8.t {I8.v b = (U32.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint32_to_int8 x = I8.int_to_t (U32.v x @% pow2 8)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int64: a:U64.t -> Tot (b:I64.t{I64.v b = (U64.v a @% pow2 64)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int64 x = I64.int_to_t (U64.v x @% pow2 64)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int32: a:U64.t -> Tot (b:I32.t{I32.v b = (U64.v a @% pow2 32)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int32 x = I32.int_to_t (U64.v x @% pow2 32)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int16: a:U64.t -> Tot (b:I16.t{I16.v b = (U64.v a @% pow2 16)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int16 x = I16.int_to_t (U64.v x @% pow2 16)
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
val uint64_to_int8 : a:U64.t -> Tot (b:I8.t {I8.v b = (U64.v a @% pow2 8)})
[@@(deprecated "with care; in C the result is implementation-defined when not representable")]
let uint64_to_int8 x = I8.int_to_t (U64.v x @% pow2 8)
/// Signed to unsigned
val int8_to_uint64: a:I8.t -> Tot (b:U64.t{U64.v b = I8.v a % pow2 64})
let int8_to_uint64 x = U64.uint_to_t (I8.v x % pow2 64)
val int8_to_uint32: a:I8.t -> Tot (b:U32.t{U32.v b = I8.v a % pow2 32})
let int8_to_uint32 x = U32.uint_to_t (I8.v x % pow2 32)
val int8_to_uint16: a:I8.t -> Tot (b:U16.t{U16.v b = I8.v a % pow2 16})
let int8_to_uint16 x = U16.uint_to_t (I8.v x % pow2 16)
val int8_to_uint8 : a:I8.t -> Tot (b:U8.t {U8.v b = I8.v a % pow2 8})
let int8_to_uint8 x = U8.uint_to_t (I8.v x % pow2 8)
val int16_to_uint64: a:I16.t -> Tot (b:U64.t{U64.v b = I16.v a % pow2 64})
let int16_to_uint64 x = U64.uint_to_t (I16.v x % pow2 64)
val int16_to_uint32: a:I16.t -> Tot (b:U32.t{U32.v b = I16.v a % pow2 32})
let int16_to_uint32 x = U32.uint_to_t (I16.v x % pow2 32)
val int16_to_uint16: a:I16.t -> Tot (b:U16.t{U16.v b = I16.v a % pow2 16})
let int16_to_uint16 x = U16.uint_to_t (I16.v x % pow2 16)
val int16_to_uint8 : a:I16.t -> Tot (b:U8.t {U8.v b = I16.v a % pow2 8})
let int16_to_uint8 x = U8.uint_to_t (I16.v x % pow2 8)
val int32_to_uint64: a:I32.t -> Tot (b:U64.t{U64.v b = I32.v a % pow2 64})
let int32_to_uint64 x = U64.uint_to_t (I32.v x % pow2 64)
val int32_to_uint32: a:I32.t -> Tot (b:U32.t{U32.v b = I32.v a % pow2 32})
let int32_to_uint32 x = U32.uint_to_t (I32.v x % pow2 32) | false | false | FStar.Int.Cast.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 int32_to_uint16: a:I32.t -> Tot (b:U16.t{U16.v b = I32.v a % pow2 16}) | [] | FStar.Int.Cast.int32_to_uint16 | {
"file_name": "ulib/FStar.Int.Cast.fst",
"git_rev": "f4cbb7a38d67eeb13fbdb2f4fb8a44a65cbcdc1f",
"git_url": "https://github.com/FStarLang/FStar.git",
"project_name": "FStar"
} | a: FStar.Int32.t -> b: FStar.UInt16.t{FStar.UInt16.v b = FStar.Int32.v a % Prims.pow2 16} | {
"end_col": 57,
"end_line": 220,
"start_col": 24,
"start_line": 220
} |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.