forked from Anniepoo/amziexpertsystemsinprolog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
car.ckb
54 lines (41 loc) · 1 KB
/
car.ckb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
goal problem.
rule 1
if not turn_over and
battery_bad
then problem is battery cf 100.
rule 2
if lights_weak
then battery_bad cf 50.
rule 3
if radio_weak
then battery_bad cf 50.
rule 4
if turn_over and
smell_gas
then problem is flooded cf 80.
rule 5
if turn_over and
gas_gauge is empty
then problem is out_of_gas cf 90.
rule 6
if turn_over and
gas_gauge is low
then problem is out_of_gas cf 30.
output problem is battery get the battery recharged.
output problem is out_of_gas start walking or hitching to a gas station.
output problem is flooded wait 5 minutes and try again.
ask turn_over
menu (yes no)
prompt 'Does the engine turn over?'.
ask lights_weak
menu (yes no)
prompt 'Are the lights weak?'.
ask radio_weak
menu (yes no)
prompt 'Is the radio weak?'.
ask smell_gas
menu (yes no)
prompt 'Do you smell gas?'.
ask gas_gauge
menu (empty low full)
prompt 'What does the gas gauge say?'.