GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||
GeezerVison is showing docs.racket-lang.org — 1 Simple Goals and Queries Racket 1 Simple Goals and Queries🔗ℹRacklog objects are the same as Racket objects. However, there are two subsets of these objects that are of special interest to Racklog: goals and predicates. We will first look at some simple goals. Predicates will introduce predicates and ways of making complex goals using predicates. A goal is an object whose truth or falsity we can check. A goal that turns out to be true is said to succeed. A goal that turns out to be false is said to fail. Two simple goals that are provided in Racklog are:
The goal %true succeeds. The goal %fail always fails. (The names of all Racklog primitive objects start with %. This is to avoid clashes with the names of conventional Racket objects of related meaning. User-created objects in Racklog are not required to follow this convention.) A Racklog user can query a goal by wrapping it in a %which-form. evaluates to (), indicating success, whereas: evaluates to #f, indicating failure. Note 1: The second subexpression of the %which-form is the empty list (). Later (Solving Goals), we will see %whiches with other lists as the second subform. Henceforth, we will use the notation:
to say that E evaluates to F. Thus,
| ||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |