-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
1,416 additions
and
116 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
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
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
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
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,70 @@ | ||
(* autogenerated from github.com/mit-pdos/gokv/globals_test *) | ||
From New.golang Require Import defn. | ||
|
||
Section code. | ||
Context `{ffi_syntax}. | ||
|
||
(* go: globals.go:3:6 *) | ||
Definition foo : val := | ||
rec: "foo" <> := | ||
exception_do (return: (#(W64 10))). | ||
|
||
Definition pkg_name' : string := "github.com/mit-pdos/gokv/globals_test". | ||
|
||
Definition GlobalX : (string * string) := (pkg_name', "GlobalX"). | ||
|
||
Definition globalY : (string * string) := (pkg_name', "globalY"). | ||
|
||
Definition globalA : (string * string) := (pkg_name', "globalA"). | ||
|
||
Definition globalB : (string * string) := (pkg_name', "globalB"). | ||
|
||
(* go: globals.go:12:6 *) | ||
Definition other : val := | ||
rec: "other" <> := | ||
exception_do (let: "$r0" := #"ok" in | ||
do: ((globals.get globalY #()) <-[stringT] "$r0")). | ||
|
||
(* go: globals.go:16:6 *) | ||
Definition bar : val := | ||
rec: "bar" <> := | ||
exception_do (do: (other #());;; | ||
(if: ((![uint64T] (globals.get GlobalX #())) ≠ #(W64 10)) || ((![stringT] (globals.get globalY #())) ≠ #"ok") | ||
then | ||
do: (let: "$a0" := (interface.make string__mset #"bad") in | ||
Panic "$a0") | ||
else do: #())). | ||
|
||
(* go: globals.go:31:6 *) | ||
Definition main : val := | ||
rec: "main" <> := | ||
exception_do (do: (bar #())). | ||
|
||
Definition define' : val := | ||
rec: "define'" <> := | ||
exception_do (do: (globals.put globalB (ref_ty stringT (zero_val stringT)));;; | ||
do: (globals.put globalA (ref_ty stringT (zero_val stringT)));;; | ||
do: (globals.put globalY (ref_ty stringT (zero_val stringT)));;; | ||
do: (globals.put GlobalX (ref_ty uint64T (zero_val uint64T)))). | ||
|
||
Definition initialize' : val := | ||
rec: "initialize'" <> := | ||
globals.package_init pkg_name' (λ: <>, | ||
exception_do (do: (define' #());;; | ||
let: "$r0" := (foo #()) in | ||
do: ((globals.get GlobalX #()) <-[uint64T] "$r0");;; | ||
let: "$r0" := #"a" in | ||
do: ((globals.get globalA #()) <-[stringT] "$r0");;; | ||
let: "$r0" := #"b" in | ||
do: ((globals.get globalB #()) <-[stringT] "$r0");;; | ||
do: ((λ: <>, | ||
exception_do (let: "$r0" := (![uint64T] (globals.get GlobalX #())) in | ||
do: ((globals.get GlobalX #()) <-[uint64T] "$r0")) | ||
) #());;; | ||
do: ((λ: <>, | ||
exception_do (let: "$r0" := #"" in | ||
do: ((globals.get globalY #()) <-[stringT] "$r0")) | ||
) #())) | ||
). | ||
|
||
End code. |
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
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
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
Oops, something went wrong.