WHAT IS A BINDING LIST? It is a list of lists of lists telling you the values of variables at a particular point in time. Each second-level list gives the values of a _set_ of variables. Each third-level list gives the value of an individual variable. Consider 2 formulas: (is-student Ted) (is-student ?x) These match if and only if ?x <- Ted. We can write this as (((?x Ted))) That's a list of lists of pairs. Each inner list is a set of values. The outer list shows that there are multiple possible sets. NOTE: You won't need to write anything like this; the system generates them for you. You will see these in the trace and may find it useful to recognize the layout. For example, if there are 2 variables that need values: (is-married Ted Mary) (is-married ?x ?y) (((?x Ted) (?y Mary))) There is only one option here (inner list). That option has 2 value pairs. -- If there is one variable with 2 possible values: Query: (is-red ?x) Result: (((?x apple)) ((?x raspberry)) ((?x strawberry))) Here there are many sublists--each sublist has one element (pair). -- If there are multiple variables with multiple possible values: Database: (is-man Ted) (is-man Bob) (is-woman Mary) (is-woman Alice) Query: ((is-man ?x) (is-woman ?y) (is-married ?x ?y)) Result has 4 sublists with 2 items each: (((?x Ted) (?y Mary)) ((?x Ted) (?y Alice)) ((?x Bob) (?y Mary)) ((?x Bob) (?y Alice))) Query: ((is-man ?x) (is-man ?z) (is-woman ?y) (is-woman ?w) (is-married ?x ?y) (is-married ?z ?w) (e-greater ?z ?x)) (not (e-equals ?y ?w))) Purpose of the e-greater clause is to ensure a unique result. Result has 2 sublist with 4 items each: (((?x Bob) (?y Mary) (?z Ted) (?w Alice)) ((?x Bob) (?y Alice) (?x Ted) (?y Mary))) -- SCOPE OF VARIABLES: A variable maintains the same value throughout a rule. A fact added to the database (i.e., via 'assert') is permanent until retracted. Note that facts do not contain variables, i.e., only relations where all arguments are known (constants) can be added to the database. -- Convention: nil = () = empty list (nil) = (()) = a list w/ one element, which happens to be the empty list