forked from FStarLang/FStar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FStarLang#1087 Add note on Map/Set extraction issues + few more F# mo…
…dules
- Loading branch information
1 parent
f7e0fc7
commit 2512af0
Showing
7 changed files
with
174 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
module FStar_CommonST | ||
|
||
open FStar_Monotonic_Heap | ||
|
||
let read x = x.contents | ||
|
||
let op_Bang x = read x | ||
|
||
let write x y = x.contents <- y | ||
|
||
let op_Colon_Equals x y = write x y | ||
|
||
let uid = ref 0 | ||
|
||
let alloc contents = | ||
let id = incr uid; !uid in | ||
let r = { id = id; contents = contents } in | ||
r | ||
|
||
let recall = (fun r -> ()) | ||
let get () = () | ||
|
||
type 'a witnessed = | C | ||
|
||
let gst_witness = (fun r -> ()) | ||
let gst_recall = (fun r -> ()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module FStar_HyperStack_All | ||
|
||
let failwith x = failwith x | ||
let exit i = exit (Microsoft.FSharp.Core.Operators.int i) | ||
let pipe_right a f = f a | ||
let pipe_left f a = f a | ||
let try_with f1 f2 = try f1 () with | e -> f2 e | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module FStar_HyperStack_IO | ||
|
||
open Prims | ||
|
||
let print_string : Prims.string -> Prims.unit = | ||
FStar_IO.print_string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
module FStar_HyperStack_ST | ||
|
||
open FStar_CommonST | ||
|
||
// TODO: Need to fix the order of compilation for extracted modules. | ||
// This realised module depends on some of the extracted modules. | ||
|
||
//open FStar_Monotonic_HyperHeap | ||
//open FStar_Monotonic_HyperStack | ||
|
||
//open FStar_HyperStack | ||
|
||
let push_frame () = () | ||
let pop_frame () = () | ||
|
||
let root = () | ||
|
||
let def_rid = root | ||
|
||
//let salloc (contents:'a) :('a reference) = | ||
// let r = FStar_CommonST.alloc contents in | ||
// MkRef (root, r) | ||
|
||
//let salloc_mm (contents:'a) :('a reference) = | ||
// let r = FStar_CommonST.alloc contents in | ||
// MkRef (root, r) | ||
|
||
//let sfree r = () | ||
|
||
//let new_region = (fun r0 -> def_rid) | ||
//let new_colored_region = (fun r0 c -> def_rid) | ||
|
||
//let ralloc i (contents:'a) :('a reference) = | ||
// let r = FStar_CommonST.alloc contents in | ||
// MkRef (i, r) | ||
|
||
//let ralloc_mm i (contents:'a) :('a reference) = | ||
// let r = FStar_CommonST.alloc contents in | ||
// MkRef (i, r) | ||
|
||
//let rfree r = () | ||
|
||
//let op_Colon_Equals r v = match r with | ||
// | MkRef (_, r) -> op_Colon_Equals r v | ||
|
||
//let op_Bang r = match r with | ||
// | MkRef (_, r) -> op_Bang r | ||
|
||
//let read = op_Bang | ||
|
||
//let write = op_Colon_Equals | ||
|
||
//let get () = HS (Prims.parse_int "0", FStar_Map.const FStar_Monotonic_Heap.emp, def_rid) | ||
|
||
//let recall = (fun r -> ()) | ||
|
||
//let recall_region = (fun r -> ()) | ||
//let witness_region _ = () | ||
//let witness_hsref _ = () | ||
//type erid = rid | ||
|
||
//type 'a ref = 'a FStar_HyperStack.reference | ||
//type ('a, 'b) mreference = 'a ref | ||
//type 'a reference = 'a ref | ||
//let alloc = salloc | ||
//type ('a, 'b) mref = 'a ref | ||
//type ('a, 'b, 'c) m_rref = 'b ref | ||
//type ('a, 'b, 'c, 'd, 'e) stable_on_t = unit | ||
//let mr_witness _ _ _ _ _ = () | ||
//let testify _ = () | ||
//let testify_forall _ = () | ||
//let testify_forall_region_contains_pred _ _ = () | ||
|
||
//type ex_rid = erid | ||
//type 'a witnessed = 'a FStar_CommonST.witnessed | ||
//type ('a, 'b, 'c, 'd) stable_on = unit | ||
//type ('a, 'b, 'c, 'd) token = unit | ||
//let witness_p _ _ = () | ||
//let recall_p _ _ = () | ||
|
||
//type drgn = rid | ||
//let new_drgn _ = () | ||
//let free_drgn _ = () | ||
//let ralloc_drgn = ralloc | ||
//let ralloc_drgn_mm = ralloc_mm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,23 @@ | ||
#light "off" | ||
module FStar_ST | ||
type 'a __ref = 'a ref | ||
type 'a ref = 'a __ref | ||
let read x = !x | ||
let op_Colon_Equals x y = x := y | ||
let alloc x = ref x | ||
|
||
let recall = (fun r -> ()) | ||
let write x y = x.contents <- y | ||
|
||
open FStar_CommonST | ||
|
||
type 'a mref = 'a FStar_Monotonic_Heap.mref | ||
type 'a ref = 'a FStar_Monotonic_Heap.ref | ||
|
||
let read = read | ||
let op_Bang = op_Bang | ||
|
||
let write = write | ||
let op_Colon_Equals = op_Colon_Equals | ||
|
||
let alloc x = alloc | ||
|
||
let recall = recall | ||
let get = get | ||
|
||
type 'a witnessed = 'a FStar_CommonST.witnessed | ||
|
||
let gst_Witness = gst_witness | ||
let gst_recall = gst_recall |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters