patterns
definition
- a pattern is a symbol or a list of symbols
- each symbol is either an atom or a variable
- a variable is prefixed with a question mark: ?v
instantiation
- given a pattern and a dictionary from vars to atoms,we can generate a symbol or a list of symbols
- example
pattern is (?greeting there ?name )
dictionary is ((?greeting hello) (?name alice))
result is (hello there alice)
matching
- given some result and a pattern, can we find a dictionary? these are called matches
- may be none or one
- examples for datum (hello there alice)
pattern (?greeting there ?firstname) – one match
pattern (?greeting there ?firstname ?lastname) – no matches
pattern (?greeting ?name) – no matches