Approaches Used in Knowledge Representation
There is no single "correct" way to represent knowledge inside a machine — different approaches trade off expressiveness, ease of reasoning, and ease of construction differently.
1. Logical (Formal) Representation
Uses propositional or predicate logic to state facts as formulas that can be manipulated with formal inference rules (e.g., modus ponens). Precise and mathematically sound; covered in depth in the next lesson.
2. Semantic Networks
A graph of nodes (objects/concepts) connected by labelled edges (relationships) such as IS-A and HAS-A.
Inheritance lets "Canary" automatically acquire properties of "Bird" and "Animal" (e.g., can fly, needs food) without stating them explicitly.
3. Frames
A frame is a data structure bundling a concept together with its attributes ("slots") and their values, similar to an object in OOP.
Frame: Car
slot: has-wheels value: 4
slot: powered-by value: engine
slot: is-a value: vehicle
slot: max-speed default: 180 km/h
Frames support default values (assumed true unless overridden) and inheritance through IS-A slots, and can attach small procedures ("procedural attachments") that run when a slot is read or written.
4. Scripts
A script represents a stereotyped sequence of events for a common situation — useful for understanding narrative/text.
Example — "Restaurant script": enter, be seated, read menu, order, eat, pay bill, leave. Once a system recognises "restaurant," it can fill in unstated but expected steps (e.g., infer a menu was read even if the text never says so).
5. Production Rules
Knowledge stated as IF–THEN rules (already introduced as the engine of production systems in Unit 1) — e.g., "IF patient has fever AND rash THEN consider measles."
Comparing the Approaches
| Approach | Strength | Weakness | Typical use |
|---|---|---|---|
| Logical | Precise, provably correct inference | Can be unwieldy for common-sense knowledge | Theorem proving, formal verification |
| Semantic networks | Intuitive, natural inheritance | Ambiguous semantics for some relations; hard to represent quantifiers | Taxonomies, ontologies |
| Frames | Good for structured, attribute-rich objects | Inheritance conflicts (multiple parents) can be tricky | Object-style domain modelling |
| Scripts | Captures expected sequences well | Rigid — poor fit for atypical situations | Story/discourse understanding |
| Production rules | Modular, easy to add/explain | Can grow unwieldy; rule interactions hard to predict at scale | Expert systems |