<> (tally ?v (Bag ?l)) ((Bag tallying| tallying> ?v ?l)) <> (tallying> ?v ()) ( (tallying> ?v ((Entry ?v ?c) ?r)) ( (tallying> ?v (?e ?r)) ((?e tallying> ?v ?r)) <> ((Bag tallying| ((?e (tally all ()) () <> (tally all (?i ?r) (Bag ?l)) (tally all ?r tally ?i (Bag ?l)) <> (find ?v (Bag ?l)) ((Bag find| find> ?v ?l)) <> (find> ?v ((Entry ?v ?c) ?r)) ( (find> ?v ()) ( (find> ?v (?e ?r)) ((?e find> ?v ?r)) <> ((Bag find| ((?e (has all ()) (#yes) <> (has all (?i ?r)) (?r has all| find ?i) <> (?r has all| #yes) (has all ?r) <> (?r has all| #no) (#no) <> (remove ?i (Bag ?r)) ((Bag remove| remove> ?i ?r)) <> (remove> ?i ()) ( (remove> ?i ((Entry ?i ?c) ?r)) (removing ((Entry ?i ?((?: ?0 ?1) ?:) - ?c 1) ?r)) <> (remove> ?i (?e ?r)) ((?e remove> ?i ?r)) <> (removing ((Entry ?i 0) ?r)) ( (removing ((Entry ?i ?c) ?r)) ( ((Bag remove| ((?e (remove all ()) () <> (remove all (?i ?r) (Bag ?l)) (remove all ?r remove ?i (Bag ?l)) <> (:) (takes>) <> (takes> >) (g>) <> (g> ;) ((Recipe () ())) <> (takes> ?i) (take ?i takes>) <> (g> ?i) (give ?i g>) <> (give ?i (Recipe ?n ?g)) ((Recipe ?n (?i ?g))) <> (take ?i (Recipe ?n ?g)) ((Recipe (?i ?n) ?g)) <> ((Recipe () ?g)) () <> (recipes) (recipes>) <> (recipes> (Bag ?l)) ( (recipes> (Recipe ?n ?g)) ((Recipe ?n ?g) recipes>) <> ((Recipe ?n ?g) ( (bag {) (bag) <> (bag }) ((Bag ())) <> (bag ?i) (tally ?i bag) <> (rewrite (Recipe ?n ?g)) (rewrite| (Recipe ?n ?g) test> ?n) <> (test> ?n (Bag ?l)) (test| ?n has all ?n (Bag ?l)) <> (test> ?n ?r) (?r test> ?n) <> (test| ?n #yes) (match| #yes remove all ?n) <> (test| ?n #no) ( (match| #yes (Bag ?l)) ( (rewrite| ?g) <> (rewrite| ) <> (?r (update> ?g (Bag ?l)) (update| tally all ?g (Bag ?l)) <> (update> ?g ?r) (?r update> ?g) <> (update| (Bag ?l)) ( (rewrite| (?r (?r ( (rewrite (Bag ?l)) (done (Bag ?l)) <> (rewrite> ?r) (?r rewrite) <> (?r done) (done) recipes : fib n > fib.shift ; : fib.shift n1 > fib.shift N2 ; : fib.shift n2 > fib.shift N1 N2 ; : fib.shift > fib.move ; : fib.move N1 > fib.move n1 ; : fib.move N2 > fib.move n2 ; : fib.move > fib ; : n1 > ; : fib > ; bag { n n n n n n1 n2 fib }