Skip to content

Commit

Permalink
Got rid of some unnecessary files and semicolons
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbert van Renesse committed Dec 19, 2023
1 parent f127335 commit 4c6def1
Show file tree
Hide file tree
Showing 12 changed files with 8 additions and 264 deletions.
31 changes: 0 additions & 31 deletions code/2pc1.hny

This file was deleted.

35 changes: 0 additions & 35 deletions code/2pc2.hny

This file was deleted.

27 changes: 0 additions & 27 deletions code/BBsema.hny

This file was deleted.

11 changes: 0 additions & 11 deletions code/BBsematest.hny

This file was deleted.

2 changes: 1 addition & 1 deletion code/DinersCV.hny
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def diner(which):
# dine
synch.acquire(?mutex)
forks[left] = forks[right] = False
synch.notify(?conds[left]);
synch.notify(?conds[left])
synch.notify(?conds[right])
synch.release(?mutex)
# think
Expand Down
58 changes: 0 additions & 58 deletions code/RWhoare.hny

This file was deleted.

42 changes: 0 additions & 42 deletions code/RWqueue.hny

This file was deleted.

24 changes: 0 additions & 24 deletions code/paxos1.hny

This file was deleted.

28 changes: 0 additions & 28 deletions code/paxos2.hny

This file was deleted.

4 changes: 2 additions & 2 deletions code/qsort.hny
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ def Qsort(arr) returns state:
state = { .arr: arr, .todo: { (0, len(arr) - 1) } }

def swap(p, q): # swap !p and !q
!p, !q = !q, !p;
!p, !q = !q, !p

def partition(qs, lo, hi) returns pivot:
pivot = lo
for i in {lo..hi - 1}:
if qs->arr[i] <= qs->arr[hi]:
swap(?qs->arr[pivot], ?qs->arr[i])
pivot += 1
swap(?qs->arr[pivot], ?qs->arr[hi]);
swap(?qs->arr[pivot], ?qs->arr[hi])

def sortrange(qs, range):
let lo, hi = range let pivot = partition(qs, lo, hi):
Expand Down
2 changes: 1 addition & 1 deletion code/qsorttest.hny
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ a = [ choose({1..NITEMS}) for i in {1..choose({1..NITEMS})} ]
testqs = qsort.Qsort(a)
sa = qsort.sort(?testqs)
assert all(sa[i - 1] <= sa[i] for i in {1..len(sa)-1}) # sorted?
assert bag.fromList(a) == bag.fromList(sa); # is it a permutation?
assert bag.fromList(a) == bag.fromList(sa) # is it a permutation?
8 changes: 4 additions & 4 deletions code/rwlock_cheat.hny
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ def RWlock() returns lock:
lock = synch.Lock()

def read_acquire(rw):
synch.acquire(rw);
synch.acquire(rw)

def read_release(rw):
synch.release(rw);
synch.release(rw)

def write_acquire(rw):
synch.acquire(rw);
synch.acquire(rw)

def write_release(rw):
synch.release(rw);
synch.release(rw)

0 comments on commit 4c6def1

Please sign in to comment.