State :: mem : map ADDR to CON
access : setof ADDR
used : setof ADDR
inv mk_State(mem,access,used) == used = dom mem;
functions
Safe : State -> bool
Safe (mk_State(-,access,used)) ==
used subset access;
Alloc : ADDR * State -> State
Alloc (addr,mk_State(mem,access,used)) == let used' = used union {addr},
mem' = mem ++ {addr |-> let c:CON in c} in
mk_State(mem',access,used') pre addr not inset used;
Alloc2 : ADDR * State -> State
Alloc2 (addr,mk_State(mem,access,used)) == let used' = used union {addr}, -- mem' = mem ++ {addr |-> <c0>}
mem' = mem munion {addr |-> let c:CON in c} in
mk_State(mem',access,used') pre addr not inset used and
addr inset access;
Alloc20 : ADDR * State -> State
Alloc20 (addr,mk_State(mem,access,used)) == let used' = used union {addr},
mem' = mem ++ {addr |-> <c0>} in
mk_State(mem',access,used') pre addr not inset used and
addr inset access;
Alloc21 : ADDR * State -> State
Alloc21 (addr,mk_State(-,access,used)) == let used' = used union {addr}, -- mem' = mem ++ {addr |-> <c0>}
mem' = {addr |-> let c:CON in c} in
mk_State(mem',access,used') pre addr not inset used and
addr inset access;
Alloc3 : ADDR * State * map ADDR to CON -> State
Alloc3 (addr,mk_State(mem,access,used),mem2) == let used' = used union {addr}, -- mem' = mem ++ {addr |-> <c0>}
mem' = mem munion {addr |-> let c:CON in c} in
mk_State(mem',access,used') pre addr not inset used and
addr inset access post mem2 = mem munion {addr |-> let c:CON in c};
functions-- conjecture
AllocSafe : ADDR * State -> bool
AllocSafe (addr,sta) ==
Safe(sta) => Safe(Alloc(addr,sta)) post RESULT = true;
AllocSafe0 : ADDR * State -> bool
AllocSafe0 (addr,sta) ==
Safe(sta) => Safe(Alloc(addr,sta)) pre addr not inset sta.used post RESULT = true;
AllocSafe2 : ADDR * State -> bool
AllocSafe2 (addr,sta) ==
Safe(sta) => Safe(Alloc(addr,sta)) pre addr not inset sta.used and
addr inset sta.access post RESULT = true;
operations
public RunTest : () ==> bool
RunTest () ==
(let s : State = mk_State({<a0> |-> <c0>}, {<a0>,<a1>}, {<a0>}) in
AllocSafe2(<a1>,s);
);
end Example3
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-10-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.