Algernon Tutorial 1.d
Bindings, Binding Lists and Binding Sets
previous next
Variable Bindings
- A variable may be bound (assigned a value) through a query
or through explicit assignment (with the
:BIND command).
- A variable's binding is passed to all succeeding clauses in the path.
Binding List
- A binding list is a set of variable bindings where each
variable name appears only once.
- A non-branching path will produce one binding list containing
a binding for each variable in the path.
- Example: [?x = 5, ?y = 12, ?z = 13].
Binding Set
- A path will branch every time a slot of a frame has multiple values.
- Most paths branch.
- A binding set contains a binding list for every branch of the reasoning tree.
- The result of processing a path is a BindingSet stored in an instance of
org.algernon.datatype.Result.
- Algernon manages the branching for you!
- Algernon will print Results for you!
Examples
- Path: ((Color DoorFrame ?color) (Width DoorFrame ?width) (Length DoorFrame ?length))
- Returns: { [?color = Blue, ?width = 36, ?length = 72] }, assuming only one value in the Color slot.
- Path: ((Friend Aaron ?friend) (age ?friend ?age))
- Might return: { [?friend = Mays, ?age = 70], [?friend = Brett, ?age = 46] }
previous next
Author: Micheal Hewett
Email: mhewett@users.sf.net
Last Updated: Monday, June 06, 2005