Programming | AI Programming |
---|---|
numbers | units, measures |
strings | symbols, concept hierarchies |
arrays, tuples | lists, facts, trees, graphs |
key-value objects | frames, triples |
dates | events, temporal relations |
=, <, > | similarity, pattern matching |
loops | recursion, search (breadth-first, depth-first, best-first, ...) |
imperative | functional, declarative |
All programming languages have symbols.
int sum = x + y;
int, sum , x, and y are symbols. So are = and +.
Symbols are never in string quotes “...”.
Code won’t work unless the symbol X is the same X every time you use it.
Symbols are often interned into namespaces.
The compiler for every language uses symbols. They're really useful.
Selfishly, few languages besides Lisp let you easily use them for your own code.
Tweety is a canary. A canary is a bird. Chilly is a penguin. A penguin is a bird. A bird is an animal.
How do we represent these so a computer can understand?
subject relation object.
tweety is-a canary. canary is-a bird. chilly is-a penguin. penguin is-a bird. bird is-a animal.
Triples are the “binary representation” of knowledge networks. There’s a W3C standard for them.
Use symbols for subjects, relations, and objects.
((tweety isa canary) (canary isa bird) (chilly isa penguin) (penguin isa bird) (bird isa animal))
Organize facts by subject.
Triples | Frames |
---|---|
((tweety isa canary) (canary isa bird) (canary color yellow) (bird isa animal) (bird airborne yes) | ((bird (animal) (airborne yes)) (canary (bird) (color yellow)) (tweety (canary))) |
Triples with common subjects and objects form a knowledge graph.
The subjects and objects are the vertices or nodes of the graph.
The relations are the labeled edges of the graph.
tweety is-a canary. canary is-a bird. chilly is-a penguin. penguin is-a bird. bird is-a animal.
tweety is-a canary. canary is-a bird. chilly is-a penguin. penguin is-a bird. bird is-a animal. bird airborne yes. penguin airborne no.
Is Tweety an animal? Can Tweety fly? Can Chilly fly?
Is Tweety an animal? Can Tweety fly?
Nixon is-a Republican. Nixon is-a Quaker. Republican is-a person. Quaker is-a person. Republican pro-war yes. Quaker pro-war no.
A well-defined order for searching the abstractions of a concept for a property. Stop with first answer found.
A linearization contains the concept and all concepts above it in an ontology, such that no concept appears to the left of a more specific concept.
OK: tweety canary bird pet animal OK: tweety pet canary bird animal NOT OK: tweety canary bird animal pet
> (get-prop 'pedal-wheel-boat 'nav-zone) (DAY-BOAT NAV-ZONE 5) > (get-prop 'small-catamaran 'nav-zone) (DAY-BOAT NAV-ZONE 5) > (get-prop 'pedalo 'nav-zone) (WHEEL-BOAT NAV-ZONE 100)