Undo changes to benchmarks to use `sub1'.
This commit is contained in:
parent
7f300a2c4f
commit
5f5dca4c69
|
@ -119,7 +119,7 @@
|
|||
(if (zero? limit)
|
||||
res
|
||||
(let ((limit
|
||||
(sub1 limit)))
|
||||
(- limit 1)))
|
||||
(_-*- limit
|
||||
(cons limit res)))))))
|
||||
|
||||
|
@ -457,7 +457,7 @@
|
|||
'(assert (procedure? folder)
|
||||
folder)
|
||||
(let*: ((root : Natural
|
||||
(sub1 size))
|
||||
(- size 1))
|
||||
(edge? : Graph
|
||||
(proc->vector size
|
||||
(lambda: ((from : Natural))
|
||||
|
@ -710,7 +710,7 @@
|
|||
((n : Natural 45) (v : (Listof RDG) '()))
|
||||
(if (zero? n)
|
||||
v
|
||||
(loop (sub1 n)
|
||||
(loop (- n 1)
|
||||
(fold-over-rdg (if input 6 1)
|
||||
2
|
||||
(ann cons (RDG (Listof RDG) -> (Listof RDG)))
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
(define (rads-of-size n)
|
||||
(let: loop1 : (Listof Radical)
|
||||
((ps : (Listof (Vectorof Natural))
|
||||
(three-partitions (sub1 n)))
|
||||
(three-partitions (- n 1)))
|
||||
(lst : (Listof Radical)
|
||||
'()))
|
||||
(if (null? ps)
|
||||
|
@ -83,7 +83,7 @@
|
|||
(define (ccp-generator j)
|
||||
(let: loop1 : (Listof Radical)
|
||||
((ps : (Listof (Vectorof Natural))
|
||||
(four-partitions (sub1 j)))
|
||||
(four-partitions (- j 1)))
|
||||
(lst : (Listof Radical)
|
||||
'()))
|
||||
(if (null? ps)
|
||||
|
@ -154,12 +154,12 @@
|
|||
(nc2 (quotient (- m nc1) 2)))
|
||||
(if (< nc2 nc1)
|
||||
(loop1 lst
|
||||
(sub1 nc1))
|
||||
(- nc1 1))
|
||||
(loop2 (cons (vector (abs nc1)
|
||||
(abs nc2)
|
||||
(abs (- m (+ nc1 nc2)))) ; abs is to appease the typechecker
|
||||
lst)
|
||||
(sub1 nc2)))))))
|
||||
(- nc2 1)))))))
|
||||
|
||||
(: four-partitions (Natural -> (Listof (Vectorof Natural))))
|
||||
(define (four-partitions m)
|
||||
|
@ -172,18 +172,18 @@
|
|||
(nc2 (quotient (- m nc1) 3)))
|
||||
(if (< nc2 nc1)
|
||||
(loop1 lst
|
||||
(sub1 nc1))
|
||||
(- nc1 1))
|
||||
(let ((start (max nc2 (- (quotient (+ m 1) 2) (+ nc1 nc2)))))
|
||||
(let loop3 ((lst lst)
|
||||
(nc3 (quotient (- m (+ nc1 nc2)) 2)))
|
||||
(if (< nc3 start)
|
||||
(loop2 lst (sub1 nc2))
|
||||
(loop2 lst (- nc2 1))
|
||||
(loop3 (cons (vector (abs nc1)
|
||||
(abs nc2)
|
||||
(abs nc3)
|
||||
(abs (- m (+ nc1 (+ nc2 nc3))))) ; abs is to appease the typechecker
|
||||
lst)
|
||||
(sub1 nc3))))))))))
|
||||
(- nc3 1))))))))))
|
||||
|
||||
(: nb (Exact-Positive-Integer -> Natural))
|
||||
(define (nb n)
|
||||
|
@ -197,5 +197,5 @@
|
|||
((n : Natural 4000) (v : Natural 0))
|
||||
(if (zero? n)
|
||||
v
|
||||
(loop (sub1 n) (nb (if input 17 1)))))))
|
||||
(loop (- n 1) (nb (if input 17 1)))))))
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
(: iota (Natural -> (Listof Natural)))
|
||||
(define (iota n)
|
||||
(do: : (Listof Natural)
|
||||
((n : Natural n (sub1 n))
|
||||
(list : (Listof Natural) '() (cons (sub1 n) list)))
|
||||
((n : Natural n (- n 1))
|
||||
(list : (Listof Natural) '() (cons (- n 1) list)))
|
||||
((zero? n) list)))
|
||||
|
||||
;;; PUZZLE -- Forest Baskett's Puzzle benchmark, originally written in Pascal.
|
||||
|
@ -195,5 +195,5 @@
|
|||
(time (let: loop : Void ((n : Natural 50) (v : Void (void)))
|
||||
(if (zero? n)
|
||||
v
|
||||
(loop (sub1 n)
|
||||
(loop (- n 1)
|
||||
(start)))))
|
||||
|
|
|
@ -94,4 +94,4 @@
|
|||
'done
|
||||
(begin
|
||||
(gogogo 22)
|
||||
(loop (sub1 n))))))
|
||||
(loop (- n 1))))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user