statement
stringlengths
2
75.7k
proof
stringlengths
0
5M
type
stringclasses
7 values
symbolic_name
stringlengths
1
82
library
stringclasses
58 values
filename
stringclasses
626 values
imports
listlengths
0
0
deps
listlengths
0
64
docstring
stringclasses
1 value
source_url
stringclasses
1 value
commit
stringclasses
1 value
{:existential true} b6: bool;
const
b6
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "true" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:existential true} b7: bool;
const
b7
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "true" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:existential true} b8: bool;
const
b8
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "true" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(b0);
axiom
b0
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "b0" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(b1);
axiom
b1
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "b1" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(b2);
axiom
b2
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "b2" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(b3);
axiom
b3
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "b3" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(b4);
axiom
b4
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "b4" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(b5);
axiom
b5
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "b5" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(!b6);
axiom
b6
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "b6" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(!b7);
axiom
b7
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "b7" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(b8);
axiom
b8
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "b8" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
main({:linear_in} x_in: [int]bool) requires b0 ==> x_in == MapConst(true); requires b1 ==> x_in != MapConst(false);
{ var x: [int] bool; x := x_in; call foo(x); assert b6 ==> x == MapConst(true); assert b7 ==> x != MapConst(false); assert b8 ==> x == MapConst(false); }
procedure
main
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "b0", "b1", "b6", "b7", "b8", "false", "foo", "int", "true" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
foo({:linear_in} x_in: [int]bool) requires b2 ==> x_in == MapConst(true); requires b3 ==> x_in != MapConst(false);
{ var x: [int] bool; x := x_in; assert b4 ==> x == MapConst(true); assert b5 ==> x != MapConst(false); }
procedure
foo
civl.regression-tests.linear
Test/civl/regression-tests/linear/f1.bpl
[]
[ "b2", "b3", "b4", "b5", "false", "int", "true" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Split({:linear_in} xls: [int]bool) returns ({:linear} xls1: [int]bool, {:linear} xls2: [int]bool); ensures xls == MapOr(xls1, xls2) && xls1 != MapConst(false) && xls2 != MapConst(false);
procedure
Split
civl.regression-tests.linear
Test/civl/regression-tests/linear/f2.bpl
[]
[ "false", "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Allocate() returns ({:linear} x: [int]bool);
procedure
Allocate
civl.regression-tests.linear
Test/civl/regression-tests/linear/f2.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
main()
{ var x: [int] bool; var x1: [int] bool; var x2: [int] bool; call x := Allocate(); assume x == MapConst(true); call x1, x2 := Split(x); assert false; }
procedure
main
civl.regression-tests.linear
Test/civl/regression-tests/linear/f2.bpl
[]
[ "Allocate", "Split", "false", "int", "true" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
A()
{}
procedure
A
civl.regression-tests.linear
Test/civl/regression-tests/linear/f3.bpl
[]
[]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
B({:linear_in} tid:int) returns({:linear} tid':int)
{ tid' := tid; call A(); }
procedure
B
civl.regression-tests.linear
Test/civl/regression-tests/linear/f3.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
f(One X): One X; yield procedure {:layer 1} D() { var a: One X; var x: One X; var b: UnitMap (One X); var c: One X; var d: One X; b->dom[a] := true; a := c; c := a; a := d; a := a; a, x := x, a; a, x := x, x; call a, x := E(a, x); call a, x := E(a, a); ...
{ c := a; }
function
f
civl.regression-tests.linear
Test/civl/regression-tests/linear/typecheck.bpl
[]
[ "true" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
G(i:int) returns ({:linear} r: One int)
{ r := g; }
procedure
G
civl.regression-tests.linear
Test/civl/regression-tests/linear/typecheck.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
H(i:int) returns ({:linear} r: One int) modifies g; { g := r; } yield procedure {:layer 1} I({:linear_in} x: One int) returns ({:linear} x': One int) { x' := x; } yield procedure {:layer 1} J() { } yield procedure {:layer 1} P1({:linear_in} x: One int) returns ({:linear} x': One int) { call x' := I(x) | J(); ...
{ call x' := I(x); call x' := I(x') | J(); }
procedure
H
civl.regression-tests.linear
Test/civl/regression-tests/linear/typecheck.bpl
[]
[ "P1", "P2", "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
List { List( data: int, next: Option (Cell Loc List) ) }
datatype
List
civl.regression-tests.linear
Test/civl/regression-tests/linear/unpack-type-error.bpl
[]
[ "Cell", "Option", "data", "int", "next" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
append(l: List, m: List) returns ({:linear} l': List)
{ var data: int; var next: Option (Cell Loc List); var cell: Cell Loc List; var loc_p: One Loc; var tl, tl': List; List(data, next) := l; if (next == Some(cell)) { Cell(loc_p, tl) := cell; call tl' := append(tl, m); cell := Cell(loc_p, tl'); } else { call loc_p := Loc_New(...
procedure
append
civl.regression-tests.linear
Test/civl/regression-tests/linear/unpack-type-error.bpl
[]
[ "Cell", "List", "Option", "Some", "data", "int", "next", "tl" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} perm (p: One int) : bool { p->val == 0 } // ########################################################################### // Main (process A sends initial proposal) atomic action {:layer 3} atomic_agree ({:linear_in} p: One int) modifies val_a, val_b; { havoc val_a, val_b; assume val_a == val_b; } yield ...
{ val_b := val; } yield procedure {:layer 0} get_val_a () returns (ret : int); refines atomic_get_val_a; yield procedure {:layer 0} set_val_a (val : int); refines atomic_set_val_a; yield procedure {:layer 0} set_val_b (val : int); refines atomic_set_val_b;
function
perm
civl.samples
Test/civl/samples/2agree.bpl
[]
[ "int", "main", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
TransactionId;
type
TransactionId
civl.samples
Test/civl/samples/2pc.bpl
[]
[]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
ReplicaId = int;
type
ReplicaId
civl.samples
Test/civl/samples/2pc.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Vote { YES(), NO(), NONE() }
datatype
Vote
civl.samples
Test/civl/samples/2pc.bpl
[]
[]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
VoteRequest { VoteRequest(xid: TransactionId, rid: ReplicaId) }
datatype
VoteRequest
civl.samples
Test/civl/samples/2pc.bpl
[]
[ "ReplicaId", "TransactionId" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
VoteRequestToken { VoteRequestToken(xid: TransactionId, rid: ReplicaId) }
datatype
VoteRequestToken
civl.samples
Test/civl/samples/2pc.bpl
[]
[ "ReplicaId", "TransactionId" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Decision { COMMIT(), ABORT() }
datatype
Decision
civl.samples
Test/civl/samples/2pc.bpl
[]
[]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Conflict: [TransactionId][TransactionId]bool;
const
Conflict
civl.samples
Test/civl/samples/2pc.bpl
[]
[ "TransactionId" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
n: int;
const
n
civl.samples
Test/civl/samples/2pc.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
0 < n;
axiom
n
civl.samples
Test/civl/samples/2pc.bpl
[]
[]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(forall xid1: TransactionId, xid2: TransactionId :: Conflict[xid1][xid2] == Conflict[xid2][xid1]);
axiom
Conflict
civl.samples
Test/civl/samples/2pc.bpl
[]
[ "Conflict", "TransactionId" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(forall xid0: TransactionId :: Conflict[xid0][xid0] == true);
axiom
Conflict
civl.samples
Test/civl/samples/2pc.bpl
[]
[ "Conflict", "TransactionId", "true" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
noConflicts(xids: [TransactionId]bool, xid: TransactionId) : bool
{ !(exists x: TransactionId :: Set_Contains(xids, x) && Conflict[x][xid]) }
function
noConflicts
civl.samples
Test/civl/samples/2pc.bpl
[]
[ "Conflict", "TransactionId" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} VoteRequests(xid: TransactionId, i: int, j: int) : [One VoteRequest]bool
{ (lambda vr: One VoteRequest :: vr->val->xid == xid && i <= vr->val->rid && vr->val->rid <= j) }
function
VoteRequests
civl.samples
Test/civl/samples/2pc.bpl
[]
[ "TransactionId", "VoteRequest", "int", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
allVoteRequests(xid: TransactionId) : [One VoteRequest]bool
{ VoteRequests(xid, 1, n) }
function
allVoteRequests
civl.samples
Test/civl/samples/2pc.bpl
[]
[ "TransactionId", "VoteRequest", "VoteRequests" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
remainingVoteRequests(xid: TransactionId, i: int) : [One VoteRequest]bool { VoteRequests(xid, i, n) } yield procedure {:layer 1} TPC({:linear} xid: One TransactionId, {:linear_in} vrs: (UnitMap (One VoteRequest))) requires {:layer 1} vrs->dom == allVoteRequests(xid->val); requires call LockedNoConflicts(); require...
{ assert (forall xid0: TransactionId :: Set_Contains(committed_transactions, xid0) ==> !Conflict[xid0][xid->val]); committed_transactions := Set_Add(committed_transactions, xid->val); }
function
remainingVoteRequests
civl.samples
Test/civl/samples/2pc.bpl
[]
[ "CommittedSubsetLocked", "Conflict", "Decision", "LockedNoConflicts", "ReplicaId", "TransactionId", "Vote", "VoteRequest", "VoteRequests", "allVoteRequests", "int", "noConflicts", "true", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} LockedNoConflicts(locked_transactions: [ReplicaId][TransactionId]bool) : bool
{ (forall {:pool "J"} j: int, xid1: TransactionId, xid2: TransactionId :: {:add_to_pool "J", j} 1 <= j && j < n+1 && xid1 != xid2 && Set_Contains(locked_transactions[j], xid1) && Set_Contains(locked_transactions[j], xid2) ==> !Conflict[xid1][xid2]) } yield invariant {:layer 1} LockedNoConflicts(); ...
function
LockedNoConflicts
civl.samples
Test/civl/samples/2pc.bpl
[]
[ "Conflict", "ReplicaId", "TransactionId", "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} CommittedSubsetLocked(locked_transactions: [ReplicaId][TransactionId]bool, committed_transactions: [TransactionId]bool) : bool
{ (forall {:pool "J"} j: int, xid0: TransactionId :: {:add_to_pool "J", j} 1 <= j && j < n+1 && Set_Contains(committed_transactions, xid0) ==> Set_Contains(locked_transactions[j], xid0)) } yield invariant {:layer 1} CommittedSubsetLocked(); preserves {:layer 1} CommittedSubsetLocked(locked_transacti...
function
CommittedSubsetLocked
civl.samples
Test/civl/samples/2pc.bpl
[]
[ "ReplicaId", "TransactionId", "int", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
numReplicas: int;
const
numReplicas
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
numReplicas > 0;
axiom
numReplicas
civl.samples
Test/civl/samples/ABD.bpl
[]
[]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
ReplicaSet = [ReplicaId]bool;
type
ReplicaSet
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "ReplicaId" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
ProcessId = int;
type
ProcessId
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
InitValue: Value;
const
InitValue
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "Value" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
TimeStamp { TimeStamp(t: int, pid: ProcessId) }
datatype
TimeStamp
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "ProcessId", "int", "pid" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} LeastTimeStamp(): TimeStamp
{ TimeStamp(0, 0) }
function
LeastTimeStamp
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "TimeStamp" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
StampedValue { StampedValue(ts: TimeStamp, value: Value) }
datatype
StampedValue
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "TimeStamp", "Value" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} NoReplicas(): ReplicaSet
{ MapConst(false) }
function
NoReplicas
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "ReplicaSet", "false" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} IsReplica(x: int): bool
{ 0 <= x && x < numReplicas }
function
IsReplica
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "int", "numReplicas" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Cardinality(q: ReplicaSet): int;
function
Cardinality
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "ReplicaSet", "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Cardinality(NoReplicas()) == 0;
axiom
Cardinality
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "NoReplicas" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
IsQuorum(rs: ReplicaSet): bool
{ 2 * Cardinality(rs) > numReplicas && (forall r: ReplicaId :: rs[r] ==> IsReplica(r)) }
function
IsQuorum
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "Cardinality", "IsReplica", "ReplicaId", "ReplicaSet", "numReplicas" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(forall rs1: ReplicaSet, rs2: ReplicaSet :: IsQuorum(rs1) && IsQuorum(rs2) ==> (exists r: ReplicaId :: IsReplica(r) && rs1[r] && rs2[r]) );
axiom
IsQuorum
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "IsQuorum", "IsReplica", "ReplicaId", "ReplicaSet" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(forall rs1: ReplicaSet, rs2: ReplicaSet :: IsQuorum(rs1) && Set_IsSubset(rs1, rs2) ==> IsQuorum(rs2));
axiom
IsQuorum
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "IsQuorum", "ReplicaSet" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} lt(ts1: TimeStamp, ts2: TimeStamp) : bool
{ (ts1->t < ts2->t) || (ts1->t == ts2->t && ts1->pid < ts2->pid) }
function
lt
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "TimeStamp", "pid" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} le(ts1: TimeStamp, ts2: TimeStamp) : bool
{ ts1 == ts2 || lt(ts1, ts2) }
function
le
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "TimeStamp", "lt" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} ValueStorePredicate(value_store: Map TimeStamp Value, ts: TimeStamp, value: Value) : bool { Map_Contains(value_store, ts) && Map_At(value_store, ts) == value } yield invariant {:layer 1} Monotonic#1(cond: bool, ts: TimeStamp, rid: ReplicaId); preserves cond ==> le(ts, replica_store[rid]->ts); yield inva...
{ if (lt(TS, ts)) { TS := ts; } }
function
ValueStorePredicate
civl.samples
Test/civl/samples/ABD.bpl
[]
[ "Copy", "InitValue", "IsQuorum", "IsReplica", "LeastTimeStamp", "Map", "Map_Contains", "ProcessId", "Read", "ReplicaId", "ReplicaSet", "StampedValue", "TimeStamp", "Value", "hide", "int", "le", "lt", "numReplicas", "pid", "true", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} PoolInv(unallocated: [int]bool, pool: UnitMap (One int)): (bool) { (forall x: int :: unallocated[x] ==> Map_Contains(pool, One(x))) } yield procedure {:layer 2} Main () preserves call Yield(); { var {:layer 1,2} l: Cell int int; var i: int; while (*) invariant {:yields} true; invariant call Y...
{ var one_i: One int; var _v: int; Cell(one_i, _v) := l; l' := Cell(one_i, o); } yield invariant {:layer 1} Yield (); preserves PoolInv(unallocated, pool); yield invariant {:layer 1} YieldMem ({:layer 1} {:linear} l: Cell int int, i: int); preserves PoolInv(unallocated, pool); preserves l->key == One(i) && l-...
function
PoolInv
civl.samples
Test/civl/samples/alloc-mem.bpl
[]
[ "Alloc", "Cell", "Main", "Map_Contains", "Read", "int", "true", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} AllocInv(count: int, unallocated: UnitMap (One int)): bool { (forall x: int :: Map_Contains(unallocated, One(x)) || x < count) } atomic action {:layer 1,1} AtomicReadLow(i: int) returns (val: int) { val := a[i]; } atomic action {:layer 1,1} AtomicWriteLow(i: int, val: int) modifies a; { a[i] := val; }...
{ unallocated' := unallocated; tid := One(i); call One_Get(unallocated', tid); }
function
AllocInv
civl.samples
Test/civl/samples/alloc-tid.bpl
[]
[ "Map_Contains", "int", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} sorted (A:[int]int, count:int) : bool { (forall i:int, j:int :: 0 <= i && i <= j && j < count ==> A[i] <= A[j]) } atomic action {:layer 2} INSERT ({:linear} tid: One Tid, v:int) modifies A, count; { var idx:int; // index at which v is written var old_A: [int]int; assert count >= 0; assert sorted(A, ...
{ assert tid->val != nil && lock == tid->val; lock := nil; } yield procedure {:layer 0} read_A ({:linear} tid: One Tid, i:int) returns (v:int); refines READ_A; yield procedure {:layer 0} write_A ({:linear} tid: One Tid, i:int, v:int); refines WRITE_A; yield procedure {:layer 0} read_count ({:linear} tid: One Tid...
function
sorted
civl.samples
Test/civl/samples/array-insert.bpl
[]
[ "Copy", "Tid", "idx", "insert", "int", "nil", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Perm { Left(i: int), Right(i: int) }
datatype
Perm
civl.samples
Test/civl/samples/bluetooth.bpl
[]
[ "Left", "Right", "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} Split(i: int, l: UnitMap (One Perm), r: UnitMap (One Perm)): bool { l->dom == Set_Singleton(One(Left(i))) && r->dom == Set_Singleton(One(Right(i))) } // user code yield procedure {:layer 2} User(i: int, {:layer 1,2} {:linear} l: UnitMap (One Perm), {:linear} {:layer 1,2} r: UnitMap (One Perm)) preserves...
{ stopped := true; } yield procedure {:layer 0} SetStopped(); refines AtomicSetStopped;
function
Split
civl.samples
Test/civl/samples/bluetooth.bpl
[]
[ "Inv1", "Inv2", "Left", "Map_Contains", "Perm", "Right", "false", "int", "true", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
MultisetEmpty: [val]int;
const
MultisetEmpty
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "int", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
MultisetEmpty == MapConst(0);
axiom
MultisetEmpty
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} MultisetSingleton(v:val) : [val]int
{ MultisetEmpty[v := 1] }
function
MultisetSingleton
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "MultisetEmpty", "int", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} MultisetSubsetEq(a:[val]int, b:[val]int) : bool
{ MapLe(a, b) == MapConst(true) }
function
MultisetSubsetEq
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "int", "true", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} MultisetPlus(a:[val]int, b:[val]int) : [val]int
{ MapAdd(a, b) }
function
MultisetPlus
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "int", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
n:int;
const
n
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
n >= 1;
axiom
n
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
val = int;
type
val
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
pid = int;
type
pid
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Permission { Broadcast(i: int), Collect(i: int) }
datatype
Permission
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} IsPid(i:int) : bool
{ 1 <= i && i <= n }
function
IsPid
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
max(values:[val]int) : val;
function
max
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "int", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
card(values:[val]int) : int;
function
card
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "int", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
card(MultisetEmpty) == 0;
axiom
card
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "MultisetEmpty" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(forall values:[val]int, v:val, x:int :: card(values[v := x]) == card(values) + x - values[v]);
axiom
card
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "card", "int", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(forall m:[val]int, m':[val]int :: MultisetSubsetEq(m, m') && card(m) == card(m') ==> m == m');
axiom
MultisetSubsetEq
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "MultisetSubsetEq", "card", "int", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(forall v:val :: max(MultisetSingleton(v)) == v);
axiom
max
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "MultisetSingleton", "max", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(forall values:[val]int, v:val, x:int :: x > 0 ==> max(values[v := x]) == (if v > max(values) then v else max(values)));
axiom
max
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "int", "max", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
value_card(v:val, value:[pid]val, j:pid) : int { if j < 1 then 0 else if value[j] == v then value_card(v, value, j-1) + 1 else value_card(v, value, j-1) } //////////////////////////////////////////////////////////////////////////////// yield invariant {:layer 1} YieldInit#1({:linear} ps: UnitMap (On...
{ call One_Put(usedPermissions, p); }
function
value_card
civl.samples
Test/civl/samples/BroadcastConsensus.bpl
[]
[ "Copy", "IsPid", "Main", "Map_Contains", "MultisetEmpty", "MultisetPlus", "MultisetSingleton", "MultisetSubsetEq", "Permission", "card", "int", "max", "pid", "true", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Tid { Tid(i: int, ps: UnitMap (One Perm)) }
datatype
Tid
civl.samples
Test/civl/samples/cav2020-3.bpl
[]
[ "Perm", "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} All(i: int): Tid
{ Tid(i, Map_Update(Map_Singleton(One(Left(i)), Unit()), One(Right(i)), Unit())) }
function
All
civl.samples
Test/civl/samples/cav2020-3.bpl
[]
[ "Left", "Right", "Tid", "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
0 < N;
axiom
N
civl.samples
Test/civl/samples/cav2020-3.bpl
[]
[]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} IsMutator(i: int) : bool
{ 1 <= i && i <= N }
function
IsMutator
civl.samples
Test/civl/samples/cav2020-3.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Mutators: UnitMap (One Perm);
const
Mutators
civl.samples
Test/civl/samples/cav2020-3.bpl
[]
[ "Perm" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Mutators->dom == (lambda p: One Perm:: p->val is Left && IsMutator(p->val->i));
axiom
Mutators
civl.samples
Test/civl/samples/cav2020-3.bpl
[]
[ "IsMutator", "Left", "Perm", "val" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Set_Size(Mutators->dom) == N;
axiom
Set_Size
civl.samples
Test/civl/samples/cav2020-3.bpl
[]
[ "Mutators" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
N > 0;
axiom
N
civl.samples
Test/civl/samples/ChangRoberts.bpl
[]
[]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} Next(i: int) : int
{ (i + 1) mod N }
function
Next
civl.samples
Test/civl/samples/ChangRoberts.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} ValidPid(pid: int) : bool
{ 0 <= pid && pid < N }
function
ValidPid
civl.samples
Test/civl/samples/ChangRoberts.bpl
[]
[ "int", "pid" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
Priority(int): int;
function
Priority
civl.samples
Test/civl/samples/ChangRoberts.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} Below(self: int, pid: int): bool
{ Priority(self) < Priority(pid) || (Priority(self) == Priority(pid) && self < pid) }
function
Below
civl.samples
Test/civl/samples/ChangRoberts.bpl
[]
[ "Priority", "int", "pid" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
ExpectedLeader: int;
const
ExpectedLeader
civl.samples
Test/civl/samples/ChangRoberts.bpl
[]
[ "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
ValidPid(ExpectedLeader);
axiom
ValidPid
civl.samples
Test/civl/samples/ChangRoberts.bpl
[]
[ "ExpectedLeader" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
(forall i: int:: ValidPid(i) ==> i == ExpectedLeader || Below(i, ExpectedLeader));
axiom
ValidPid
civl.samples
Test/civl/samples/ChangRoberts.bpl
[]
[ "Below", "ExpectedLeader", "ValidPid", "int" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b
{:inline} Pid(pos: int) : int { (ExpectedLeader + pos) mod N } //////////////////////////////////////////////////////////////////////////////// yield left procedure {:layer 1} main() requires {:layer 1} leader == MapConst(false); ensures {:layer 1} leader == Set_Singleton(ExpectedLeader); modifies leader; { var pos...
{ leader[pid] := true; }
function
Pid
civl.samples
Test/civl/samples/ChangRoberts.bpl
[]
[ "Below", "ExpectedLeader", "Next", "ValidPid", "false", "int", "main", "pid", "true" ]
https://github.com/boogie-org/boogie
24a23f9041646167445f8871e59e27d633f8642b