eratosthenes_small.itrs

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:14.0
disk size 480 Bytes
downloadable true
type
attribute value
name no_type
processor id 1
description this is the default benchmark type for rejected benchmarks and benchmarks that are not associated with a type.
owning community none
loading contents
(VAR x y ys zs)
(RULES
primes(x) -> sieve(nats(2, x))
nats(x, y) -> nil :|: x > y
nats(x, y) -> cons(x, nats(x + 1, y)) :|: y >= x
sieve(nil) -> nil
sieve(cons(x, ys)) -> cons(x, sieve(filter(x, ys)))
filter(x, nil) -> nil
filter(x, cons(y, zs)) -> if(isdiv(x, y), x, y, zs)
if(TRUE, x, y, zs) -> filter(x, zs)
if(FALSE, x, y, zs) -> cons(y, filter(x, zs))
isdiv(x, 0) -> TRUE :|: x > 0
isdiv(x, y) -> FALSE :|: x > y && y > 0
isdiv(x, y) -> isdiv(x, y - x) :|: y >= x && x > 0
)
popout

content may be truncated. 'popout' for larger text window.

actions get anonymous link download benchmark