(defvar x 1)
(defvar y (+ x 2))
x
y
- (.98 = 99/101)
1 3
- (.01 = 1/101)
1 2
- (.01 = 1/101)
error
(defvar xyz 173)
abc
- (.98 = 98/100)
error
- (.01 = 1/100)
173
- (.01 = 1/100)
possibly abc
(deffun (sum x y z)
(+ x (+ y z)))
(sum 2 1 3)
- (.99 = 100/101)
6
- (.01 = 1/101)
5
(deffun (addy x)
(defvar y 1)
(+ x y))
(addy 2)
- (.97 = 98/101)
3
- (.03 = 3/101)
error
(defvar y 1)
(deffun (addy x)
(+ x y))
(addy 2)
- (.77 = 79/102)
3
- (.23 = 23/102)
error
[IsolatedFun]
(deffun (addy x)
(+ x y))
(defvar y 1)
(addy 2)
- (.67 = 68/101)
error
[DeepClosure, IsolatedFun, NestedDef] - (.32 = 32/101)
3
- (.01 = 1/101)
2
(defvar y 100)
(deffun (addy x)
(defvar y 200)
(+ x y))
(addy 2)
- (.91 = 92/101)
202
- (.05 = 5/101)
102
- (.04 = 4/101)
error
(defvar y 100)
(deffun (addy x)
(defvar y 200)
(+ x y))
(+ (addy 2) y)
- (.93 = 95/102)
302
- (.06 = 6/102)
402
[FlatEnv] - (.01 = 1/102)
error
(deffun (addy x)
(defvar y 200)
(+ x y))
(+ (addy 2) y)
- (.96 = 98/102)
error
- (.04 = 4/102)
402
[FlatEnv]
(defvar x 1)
(deffun (main)
(defvar x 2)
(deffun (get-x) x)
(get-x))
(main)
- (.85 = 85/100)
2
- (.09 = 9/100)
error
[IsolatedFun] - (.05 = 5/100)
1
- (.01 = 1/100)
3
(defvar x 1)
(deffun (get-x) x)
(deffun (main)
(defvar x 2)
(get-x))
(main)
- (.70 = 71/102)
1
- (.29 = 30/102)
2
[FlatEnv] - (.01 = 1/102)
error
[IsolatedFun]
(defvar x 1)
(deffun (main)
(defvar x 2)
(get-x))
(deffun (get-x) x)
(main)
- (.76 = 77/101)
1
- (.14 = 14/101)
error
[DeepClosure, IsolatedFun, NestedDef] - (.10 = 10/101)
2
[FlatEnv]
(defvar x 1)
(deffun (main)
(deffun (get-x) x)
(defvar x 2)
(get-x))
(main)
- (.92 = 93/101)
2
- (.08 = 8/101)
1
[NestedDef]
(defvar x 1)
(defvar x 2)
x
- (.63 = 63/100)
2
[DefOrSet, NestedDef] - (.36 = 36/100)
error
- (.01 = 1/100)
1
(deffun (f x x)
(+ x x))
(f 1 2)
- (.92 = 92/100)
error
- (.07 = 7/100)
3
- (.01 = 1/100)
2
(/ 1 0)
- (.97 = 92/95)
error
- (.02 = 2/95)
1
- (.01 = 1/95)
0
(defvar x (/ 1 0))
42
- (.71 = 67/95)
error
- (.29 = 28/95)
42
[Lazy]
(deffun (f x)
42)
(f (/ 1 0))
- (.92 = 87/95)
error
- (.08 = 8/95)
42
[Lazy]
(defvar x 1)
(defvar y (+ x 2))
x
y
- (.99 = 93/94)
1 3
- (.01 = 1/94)
error
(defvar y (+ x 2))
(defvar x 1)
x
y
- (.57 = 54/95)
1 3
[Lazy] - (.43 = 41/95)
error
(deffun (getx)
x)
(defvar x 12)
(defvar y (getx))
y
- (.76 = 72/95)
12
- (.24 = 23/95)
error
[DeepClosure, IsolatedFun, NestedDef]
(deffun (getx)
x)
(defvar y (getx))
(defvar x 12)
y
- (.63 = 60/95)
error
- (.37 = 35/95)
12
[Lazy]
(defvar x 2)
(deffun (main)
(deffun (getx)
x)
(defvar y (getx))
(defvar x 3)
y)
(main)
- (.60 = 56/94)
2
[DefOrSet, NestedDef] - (.28 = 26/94)
error
- (.13 = 12/94)
3
[Lazy]
(defvar x 0)
(defvar y x)
(defvar x 2)
x
y
- (.86 = 78/91)
error
- (.13 = 12/91)
2 0
[DefOrSet, NestedDef] - (.01 = 1/91)
2 2
(deffun (foo)
y)
(defvar y 1)
(foo)
- (.81 = 74/91)
1
- (.19 = 17/91)
error
[DeepClosure, IsolatedFun, NestedDef]
(defvar x 1)
(deffun (gety)
(defvar y x)
(defvar x 2)
y)
(gety)
- (.65 = 59/91)
error
- (.30 = 27/91)
1
[DefOrSet, NestedDef] - (.05 = 5/91)
2
[Lazy]
(defvar rent 100)
(set! rent (* 100 2))
rent
- (.99 = 91/92)
200
- (.01 = 1/92)
2000
(set! foobar 2)
foobar
- (.85 = 79/93)
error
- (.15 = 14/93)
2
[DefOrSet]
(defvar x 12)
(defvar y x)
(set! x 0)
x
y
- (.85 = 79/93)
0 12
- (.12 = 11/93)
0 0
[DefByRef] - (.02 = 2/93)
error
- (.01 = 1/93)
depends on implementation
(defvar m 40)
(defvar n m)
(set! n 22)
m
n
- (.99 = 92/93)
40 22
- (.01 = 1/93)
40 11
(defvar x 1)
(defvar y (+ x 100))
(set! x 2)
x
y
- (.99 = 92/93)
2 101
- (.01 = 1/93)
2 102
(defvar x 12)
(deffun (f)
(set! x 0))
(f)
x
- (.89 = 83/93)
0
- (.05 = 5/93)
12
[DeepClosure, DefOrSet] - (.05 = 5/93)
error
[IsolatedFun]
(defvar x 12)
(deffun (f x)
(set! x 0))
(f x)
x
- (.52 = 48/93)
12
- (.41 = 38/93)
0
[CallByRef, FlatEnv] - (.08 = 7/93)
error
(defvar x 1)
(deffun (getx)
x)
(deffun (setx new-val)
(set! x new-val))
(getx)
(setx 2)
(getx)
- (.78 = 73/93)
1 2
- (.20 = 19/93)
1 1
[DeepClosure, DefOrSet] - (.01 = 1/93)
1 2 1
(defvar x 12)
(deffun (set-and-return y)
(set! y 0)
x)
(set-and-return x)
- (.78 = 73/93)
12
- (.11 = 10/93)
error
[IsolatedFun] - (.10 = 9/93)
0
[CallByRef] - (.01 = 1/93)
23
(defvar x 12)
(deffun (set-and-return y)
(set! x 0)
y)
(set-and-return x)
x
- (.80 = 74/92)
12 0
- (.07 = 6/92)
12 12
[DeepClosure, DefOrSet] - (.07 = 6/92)
error
[IsolatedFun] - (.03 = 3/92)
0 0
[CallByRef] - (.03 = 3/92)
12
(defvar n 3)
(deffun (f x)
(+ x 1))
(mvec n (f n))
- (.97 = 89/92)
#(3 4)
- (.02 = 2/92)
error
- (.01 = 1/92)
#(n (f n))
(mvec (mvec 1 2) 3)
- (.96 = 88/92)
#(#(1 2) 3)
- (.02 = 2/92)
error
- (.01 = 1/92)
#(#(1 2) #(3))
- (.01 = 1/92)
#(#(3 1) 2)
(mvec (mvec 123) (mvec 4 5))
- (.91 = 84/92)
#(#(123) #(4 5))
- (.05 = 5/92)
#('#(123) '#(4 5))
- (.02 = 2/92)
error
- (.01 = 1/92)
#('#(231) '#(4 5))
(defvar v (mvec 1 2 3 4))
(vec-len v)
- (.99 = 90/91)
4
- (.01 = 1/91)
error
(vec-len (mvec 4 (mvec 5 6)))
- (.95 = 86/91)
2
- (.03 = 3/91)
3
- (.01 = 1/91)
1
- (.01 = 1/91)
error
(defvar v (mvec (mvec 10 20) (mvec 30 40)))
(vec-ref (vec-ref v 1) 0)
- (.81 = 74/91)
30
- (.11 = 10/91)
10
- (.04 = 4/91)
20
- (.02 = 2/91)
error
- (.01 = 1/91)
1
(defvar x (mvec 2 3))
(vec-set! x 0 100)
x
- (.87 = 79/91)
#(100 3)
- (.13 = 12/91)
100 3
(defvar x (mvec 2))
(vec-set! x 0 100)
x
- (.97 = 88/91)
#(100)
- (.03 = 3/91)
100
(defvar mv (mvec 4 5))
(left mv)
- (.87 = 79/91)
4
- (.13 = 12/91)
error
(defvar m (mvec 1 2))
(vec-set! m 1 (mvec 3 4))
(vec-ref m 2)
- (.93 = 84/90)
error
- (.02 = 2/90)
2
- (.02 = 2/90)
4
- (.01 = 1/90)
#(3 4)
- (.01 = 1/90)
3
(defvar x (mvec 100))
(defvar y x)
(vec-set! x 0 200)
y
- (.67 = 62/92)
#(100)
[DefsCopyStructs] - (.30 = 28/92)
#(200)
- (.01 = 1/92)
#(300)
- (.01 = 1/92)
error
vectors2::alias_with_funcall
(defvar x (mvec 1 0))
(deffun (f y)
(vec-set! y 0 173))
(f x)
x
- (.90 = 83/92)
#(173 0)
- (.10 = 9/92)
#(1 0)
[CallsCopyStructs]
(defvar x 3)
(defvar v (mvec 1 2 x))
(set! x 4)
v
- (.67 = 62/92)
#(1 2 3)
- (.24 = 22/92)
#(1 2 4)
[StructByRef] - (.09 = 8/92)
error
(defvar x (mvec 3))
(defvar v (mvec 1 2 x))
(vec-set! x 0 4)
v
- (.84 = 77/92)
#(1 2 #(4))
- (.14 = 13/92)
#(1 2 #(3))
[DefsCopyStructs, StructsCopyStructs] - (.02 = 2/92)
error
(defvar x (mvec 3))
(defvar v (mvec 1 2 x))
(set! x 4)
v
- (.48 = 44/92)
error
- (.43 = 40/92)
#(1 2 #(3))
- (.08 = 7/92)
#(1 2 #(4))
- (.01 = 1/92)
#(1 2 3)
(defvar v (mvec 1 2 3))
(defvar vv (mpair v v))
(vec-set! (right vv) 0 100)
(left vv)
- (.80 = 74/92)
#(100 2 3)
- (.18 = 17/92)
#(1 2 3)
[DefsCopyStructs] - (.01 = 1/92)
error
(defvar x (mvec 1 0 2))
(vec-set! x 1 x)
(vec-len x)
- (.76 = 70/92)
3
- (.14 = 13/92)
error
[NoCircularity] - (.09 = 8/92)
run out of memory or time.
- (.01 = 1/92)
+inf
(defvar v (mpair 10 7))
(set-left! v v)
(set-right! v 42)
(right (left (left v)))
- (.60 = 55/92)
42
- (.30 = 28/92)
error
[NoCircularity, StructsCopyStructs] - (.07 = 6/92)
10
- (.03 = 3/92)
7
(defvar x 12)
(deffun (f x)
(set! x 0))
(f x)
x
- (.88 = 79/90)
12
- (.12 = 11/90)
0
[CallByRef, FlatEnv]
(defvar x 5)
(deffun (set1 x y)
(set! x y))
(deffun (set2 a y)
(set! x y))
(set1 x 6)
x
(set2 x 7)
x
- (.66 = 59/90)
5 7
- (.24 = 22/90)
5 5
[DeepClosure, DefOrSet] - (.09 = 8/90)
6 7
[CallByRef, FlatEnv] - (.01 = 1/90)
error
(defvar x (mvec 1 7 3))
(defvar pr (mpair x x))
(vec-set! (right pr) 0 100)
pr
- (.93 = 84/90)
#(#(100 7 3) #(100 7 3))
- (.07 = 6/90)
#(#(1 7 3) #(100 7 3))
[DefsCopyStructs]
(defvar x (mvec 2 3))
(set-right! x x)
(set-left! x x)
x
- (.63 = 57/90)
#0='#(#0# #0#) ;; an mpair whose elements refer back to itself
- (.23 = 21/90)
#(#(2 3) #(2 3))
- (.08 = 7/90)
#(#(2 #(2 3)) #(2 3))
[StructsCopyStructs] - (.06 = 5/90)
error
[NoCircularity]
(deffun (get) 42)
(defvar f get)
(defvar g f)
(g)
- (.99 = 88/89)
42
- (.01 = 1/89)
error
[FunNotVal]
(deffun (twice f x)
(f (f x)))
(deffun (double x)
(+ x x))
(twice double 1)
- (.83 = 75/90)
4
- (.11 = 10/90)
error
[FunNotVal] - (.04 = 4/90)
2
- (.01 = 1/90)
8
(deffun (add1 x) (+ x 1))
(deffun (g) add1)
(defvar f (g))
(f 100)
- (.71 = 64/90)
101
- (.29 = 26/90)
error
[FunNotVal, IsolatedFun]
(deffun (add1 n)
(+ n 1))
(defvar v (mvec add1))
((vec-ref v 0) 2)
- (.78 = 70/90)
3
- (.12 = 11/90)
error
[FunNotVal] - (.08 = 7/90)
2
- (.02 = 2/90)
1
(deffun (make-getter)
(defvar x 1)
(deffun (get-x) x)
get-x)
(defvar get-x (make-getter))
(get-x)
- (.91 = 82/90)
1
- (.09 = 8/90)
error
[FunNotVal, IsolatedFun]
(deffun (make-getter x)
(deffun (get-x) x)
get-x)
(defvar get-a (make-getter 1))
(defvar get-b (make-getter 2))
(get-a)
(get-b)
- (1.00 = 89/89)
1 2
(deffun (make-addy y)
(deffun (addy x)
(+ x y))
addy)
(defvar f (make-addy 10))
(defvar g (make-addy 50))
(f 2)
(g 2)
- (.74 = 66/89)
12 52
- (.25 = 22/89)
error
[FunNotVal, IsolatedFun] - (.01 = 1/89)
12 12
(defvar x 1)
(deffun (make-f)
(deffun (addx y)
(+ x y))
addx)
(defvar f (make-f))
(set! x 2)
(f x)
- (.50 = 45/90)
4
- (.30 = 27/90)
3
[DeepClosure] - (.16 = 14/90)
error
[FunNotVal, IsolatedFun] - (.04 = 4/90)
2
(deffun (make-counter count)
(deffun (counter)
(set! count (+ count 1))
count)
counter)
(defvar f (make-counter 0))
(defvar g (make-counter 0))
(f)
(f)
(g)
- (.77 = 69/90)
1 2 1
- (.11 = 10/90)
1 2 3
[FlatEnv] - (.08 = 7/90)
1 1 1
[DeepClosure] - (.01 = 1/90)
1 1 2
- (.01 = 1/90)
2 3 2
- (.01 = 1/90)
3 1 2
- (.01 = 1/90)
error
[DefOrSet, FunNotVal, IsolatedFun]
(deffun (f a b) a + b)
(f 5 10)
- (.58 = 52/90)
15
- (.32 = 29/90)
error
[FunNotVal] - (.09 = 8/90)
10
- (.01 = 1/90)
5 + 10
(deffun (f x)
(lambda (y) (+ x y)))
(defvar x 0)
((f 2) 1)
- (.94 = 85/90)
3
- (.03 = 3/90)
error
[FunNotVal, IsolatedFun] - (.01 = 1/90)
1
- (.01 = 1/90)
2
(defvar x 1)
(defvar f
(lambda (y)
(+ x y)))
(set! x 2)
(f x)
- (.86 = 77/90)
4
- (.10 = 9/90)
3
[DeepClosure] - (.03 = 3/90)
error
[IsolatedFun] - (.01 = 1/90)
lambda
(deffun (make-counter count)
(lambda ()
(set! count (+ count 1))
count))
(defvar f (make-counter 0))
(defvar g (make-counter 0))
(f)
(f)
(g)
- (.99 = 89/90)
1 2 1
- (.01 = 1/90)
1 2 3
[FlatEnv]