Original JavaScript

[1] This uses the dotted-tail notation introduced in exercise 2.20.
[2] Actually, this description of not is valid only for simple cases. The real behavior of not is more complex. We will examine not's peculiarities in sections 4.4.2 and 4.4.3.
[3] Lisp-value should be used only to perform an operation not provided in the query language. In particular, it should not be used to test equality (since that is what the matching in the query language is designed to do) or inequality (since that can be done with the same rule shown below).
[4] A query should use javascript_predicate only to perform an operation not provided in the query language. In particular, javascript_predicate should not be used to test equality (since that is what the matching in the query language is designed to do) or inequality (since that can be done with the same rule shown below).
[5] Notice that we do not need same in order to make two things be the same: We just use the same pattern variable for each—in effect, we have one thing instead of two things in the first place. For example, see ?town $town in the lives-near lives_near rule and ?middle-manager $middle_manager in the wheel rule below. Same The same relation is useful when we want to force two things to be different, such as ?person-1 $person_1 and ?person-2 $person_2 in the lives-near lives_near rule. Although using the same pattern variable in two parts of a query forces the same value to appear in both places, using different pattern variables does not force different values to appear. (The values assigned to different pattern variables may be the same or different.)
[6] We will also allow rules without bodies, as in same, and we will interpret such a rule to mean that the rule conclusion is satisfied by any values of the variables.
[7] We will also allow rules without bodies, as in same, and we will interpret such a rule to mean that the rule conclusion is satisfied by any values of the variables.
4.4.1   Deductive Information Retrieval