-
Notifications
You must be signed in to change notification settings - Fork 8
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
26 changed files
with
844 additions
and
237 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
32 changes: 32 additions & 0 deletions
32
...es/transactional_consistency/read_uncommitted/examples/read_own_data/read_own_data_code.v
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,32 @@ | ||
(* This file is automatically generated from the OCaml source file | ||
<repository_root>/ml_sources/examples/transactional_consistency/read_uncommitted/examples/read_own_data/read_own_data_code.ml *) | ||
|
||
From aneris.aneris_lang Require Import ast. | ||
From aneris.aneris_lang.lib.serialization Require Import serialization_code. | ||
From aneris.examples.transactional_consistency.snapshot_isolation Require Import snapshot_isolation_code. | ||
From aneris.examples.transactional_consistency.snapshot_isolation.util Require Import util_code. | ||
|
||
Definition transaction1 : val := | ||
λ: "cst", start "cst";; | ||
write "cst" #"x" #1;; | ||
commitU "cst". | ||
|
||
Definition transaction2 : val := | ||
λ: "cst", | ||
start "cst";; | ||
write "cst" #"x" #2;; | ||
let: "vx" := read "cst" #"x" in | ||
assert: ("vx" = (SOME #2));; | ||
commitU "cst". | ||
|
||
Definition transaction1_client : val := | ||
λ: "caddr" "kvs_addr", | ||
let: "cst" := init_client_proxy int_serializer "caddr" "kvs_addr" in | ||
transaction1 "cst". | ||
|
||
Definition transaction2_client : val := | ||
λ: "caddr" "kvs_addr", | ||
let: "cst" := init_client_proxy int_serializer "caddr" "kvs_addr" in | ||
transaction2 "cst". | ||
|
||
Definition server : val := λ: "srv", init_server int_serializer "srv". |
Oops, something went wrong.