Lecture 2 - Expert systems Flashcards
propositional logic
antecedent-consequent rules
(if A then B)
predicate logic
to connect symbols
(A is a form of B)
Greedy algorithm
Algorithms that choose the locally optimal choice at each stage are known as greedy algorithms.
Expert system:
- consists of (2)
- definition
A knowledge base
An inference engine
An expert system represents an expert’s understanding of a subject.
Expert system:
knowledge base
- predicate or propositional logic?
- Definition
- example
The knowledge base represents facts about the world and about the way in which concepts are related to each other, often using predicate logic.
Example:
Leukemia is a disease
Chemotherapy is a treatment
John Smith is a patient
But also more complex relationships:
Leukemia is an abnormality of the blood
Anemia is a side effect of chemo therapy
Expert system
- inference engine
- predicate or propositional logic?
- example
The knowledge base with its symbolic descriptions is not enough, we need to be able to manipulate the symbols.
Not only propositional logic, but also predicate logic
Examples:
Patient X suffers from Leukemia (Fact 1)
Leukemia is an abnormality of the blood (Fact 2)
If patient suffers from an abnormality in the blood, then schedule weekly blood test (Rule 1)
-> Patient X should be scheduled for a weekly blood test (deduced conclusion)
Expert systems: Complex rules
If Anemia is present
Then an iron supplement is required
If Anemia is present
And spleen is enlarged
Then investigation for Hodgkin’s disease is desirable
If the patient’s data satisfies rule 2, then rule 1 will also be satisfied.
So,
Should we:
Give iron supplements?
Check for Hodgkin’s?
-> answer is not clear
-> we neem more control over which rules to apply (control the use of knowledge)
Three ways to control the use of knowledge
Three ways to control the use of knowledge:
Forward chaining*
Backward chaining*
Control knowledge*
Forward chaining
- definition
- example
Works sequentially:
From given statements to a deduced conclusion
Algorithmic form:
Until no rule produces a new assertation or the animal is identified:
For each rule:
Try to support each of the antecedents by fact matching
If all antecedents are supported, assert the consequent
Example:
Our robot encounters a new animal, Scruffy
Scruffy has:
Hair
chews cud
has long legs
a long neck,
a tawny color
dark spots
How would forward chaining solve this classification problem?
Because Scruffy has hair:
-> rule 1 fires.
-> Now we know that Scruffy is a mammal.
Because Scruffy is a mammal and chews cud
-> rule 8 fires
-> Scruffy is an ungulate.
All antecedents for rule 11 are satisfied
-> Scruffy is a giraffe!
Backward chaining
- definition
- example
- check sheet
Backward chaining starts at the opposite end of the logical process.
It starts by forming a hypothesis
-> using if–then rules to work backward toward hypothesis-supporting assertions.
Algorithmic form:
Until all hypotheses have been tried or until animal is identified
For each hypothesis:
For each rule whose consequent matches the current hypothesis:
Try to support each of the antecedents by fact matching or by backward chaining through another rule
If all antecedents are supported, conclude the hypothesis to be true
Example:
Our robot encounters a new animal, Swifty.
Our robot forms the (random or pre-informed) hypothesis that Swifty is a cheetah.
So how do we decide which chaining direction to use?
Backward chaining in case of …
- example
In cases where not all facts are known yet
Example:
When investigating the carnivore hypothesis, questions about teeth are asked, but irrelevant questions such as color are skipped.
Forward chaining
- in case of …
In cases when you want to know everything you can from a set of facts
Example:
When seeing an animal quickly, you want to know what you can deduce from your observation.