12 Property-based Shell, Structured-based Diagnosis
The domain knowledge is represented by structuring the domain in objects with properties:
G -- question : Q -- answers : A -- reasons : R -- explanation : E .
The meaning is:
- Name of the object.
- Question to the user (or a test).
- A = [ 1: A1, 2: A2... ]:
- Ai = a possible answer of the user (or the resultat of a test).
- R = [ i: Gi, j: Gj, ...]:
- Gi = a possible justification for G, if Ai applies. If i was the answer and Gi = true, then G is proven.
- R = [ G1, G2, ...]:
- G1, G2, ... are possible reasons for G, if there is no 'question' attribute Q.
- Explanation (text), if G is proven
The attributes 'question' und 'answers' are optional; the attribute 'reasons' is mandatory; the attribute 'explanation' is mandatory for proven goals.
Implement the predicate
solve( G, X) /* X is the reason for the Goal G */
according to the lecture notes. The user should be asked at most once to any question.
The predicate 'solve' from the example 12.1 can be used for struktured-based diagnosis. The inferenz proceeds from symptoms to diagnoses. The interpretation of the objects in the diagnosis realm is:
- object :
- symptom or diagnosis
- question or test (text)
- reasons for a symptom (simpler symptoms) or diagnoses
- explanation of a diagnosis (text)
Test the shell on the example of the diagnosis of a broken bike:
|Symptom||Simpler symptom or diagnosis|
|bike||ride (driving properties), elektric (lamp)|
|ride||wheels (difficult or clumsy riding), drive (noise), brakes|
|wheels||tires (flat), operation (unbalanced = diagnosis)|
|tires||valve (loose, missing = diagnosis), puncture = diagnose|
|operation||chain (rusty = diagnosis), gears = diagnosis|
|brakes||cable = diagnosis, brake pads = diagnosis|
|electric||lamp = diagnosis, cable = diagnosis, dynamo contact = diagnosis|
bike -- question : 'What is the problem with your bike ?' -- answers : [ 1 : 'driving properties', 2 : 'lamp' ] -- reasons : [ 1: ride, 2 : electric ]. ride -- question : ... . flat_tire -- reasons : [ air, valve, puncture ]. puncture -- question: 'Is there a puncture in the tire?' -- answers: [ 1: yes, 2: no] -- reasons: [ 1: true] -- explanation: 'There was puncture in the tire. Fix it.'.