; A starter file with some simple facts that define addition as
; well as appending two lists.
;
; Used in CS61A, made by: Mark Miyashita
(fact (increment 0 1))
(fact (increment 1 2))
(fact (increment 2 3))
(fact (increment 3 4))
(fact (increment 4 5))
(fact (increment 5 6))
(fact (increment 6 7))
(fact (increment 7 8))
(fact (increment 8 9))
(fact (increment 9 10))
(fact (increment 10 11))
(fact (increment 11 12))
(fact (increment 12 13))
(fact (add 1 ?x ?x+1)
(increment ?x ?x+1))
(fact (add ?x+1 ?y ?z+1)
(increment ?x ?x+1)
(increment ?z ?z+1)
(add ?x ?y ?z))
(query (add 2 4 6))
; expect Success!
(query (add 1 1 3))
; expect Failed.
(query (add 1 1 ?what))
; expect Success! ; what: 2
(fact (append () ?a ?a))
(fact (append (?x . ?r) ?b (?x . ?c))
(append ?r ?b ?c))
(query (append (1 2) (3 4) (1 2 3 4)))
; expect Success!
(query (append (1 2) (3 ?what) (1 2 3 5)))
; expect Success! ; what: 5