vault backup: 2025-03-24 10:13:11
This commit is contained in:
parent
b99aea1134
commit
9774fc006c
2 changed files with 23 additions and 3 deletions
|
@ -154,5 +154,25 @@ TOP : a register that can be read or compare&setted
|
|||
```
|
||||
push(w) :=
|
||||
while true do ⟨i,v,s⟩ <- TOP
|
||||
conclude(i,v,s) if i=k then return FULL newtop ß ⟨i+1,w,STACK[i+1].seq_num+1⟩ if TOP.compare&set(⟨i,v,s⟩,newtop) then return OK
|
||||
```
|
||||
conclude(i,v,s)
|
||||
if i=k then
|
||||
return FULL
|
||||
newtop <- ⟨i+1,w,STACK[i+1].seq_num+1⟩
|
||||
if TOP.compare&set(⟨i,v,s⟩,newtop) then
|
||||
return OK
|
||||
|
||||
conclude(i, v, s) :=
|
||||
tmp <- STACK[i].val
|
||||
STACK[i].compare&set(⟨tmp,s-1⟩,⟨v,s⟩)
|
||||
|
||||
pop() :=
|
||||
while true do
|
||||
⟨i,v,s⟩ <- TOP
|
||||
conclude(i,v,s)
|
||||
if i=k then
|
||||
return FULL
|
||||
newtop <- ⟨i+1,w,STACK[i+1].seq_num+1⟩
|
||||
if TOP.compare&set(⟨i,v,s⟩,newtop) then
|
||||
return OK
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue