我是 Clips 软件的新手,当我加载我的 .clp 文件和 运行 我的程序时,它最后显示错误
I am new to clips software, when i loaded my .clp file and run my program at last it is showing false
这是解决汽车启动问题的专家系统。我在创建规则时犯了什么错误吗?我想要 5 种不同的输出。
(defrule r1
(Key-fob-turns-to-run-and-hear-crank yes)
=>
(printout t "Hear engine sound (Yes/No)?" crlf)
(assert (engine sound(read))))
(defrule r2
(engine sound yes)
=>
(printout t "If engine runs and stop after a while (Yes/No)?" crlf)
(assert (engine runs and stop(read))))
(defrule r3
(engine runs and stop no)
=>
(printout t "There is no fuel, low battery or other issues." crlf))
(defrule r4
(engine runs and stop yes)
=>
(printout t "Check if engine light is on (Yes/No)?" crlf)
(assert (engine light(read))))
(defrule r5
(engine light no)
=>
(printout t " Check for any other warning signs and take it to mechanic" crlf))
(defrule r6
(engine light yes)
=>
(printout t "Any service code (yes/no)?" crlf)
(assert (service code(read))))
(defrule r7
(service code yes)
=>
(printout t "Read code and fix the problem" crlf))
(defrule r8
(service code no)
=>
(printout t "Check if it stalls in rain (Yes/No)?" crlf)
(assert (stalls in rain(read))))
(defrule r9
(stalls in rain yes)
=>
(printout t "Check for cracked coil distributor" crlf))
(defrule r10
(stalls in rain no)
=>
(printout t "check if it stalls in warm (Yes/No)?" crlf)
(assert (stalls in warm(read))))
(defrule r11
(stalls in warm yes)
=>
(printout t "Adjust idle, blow out fuel filter." crlf)
(printout t "Check fuel pump output and check vaccum leak." crlf))
(defrule r12
(stalls in warm no)
=>
(printout t "ON cold stalling, check for stuck choke, EGR and check vaccum leak." crlf))
(defrule r13
(engine sound no)
=>
(printout t "check the belt is ok (Yes/No)?" crlf)
(assert (belt ok(read))))
(defrule r14
(belt ok yes)
=>
(printout t "Fuel in tank (Yes/No)?" crlf)
(assert (fuel in tank(read))))
(defrule r15
(fuel in tank no)
=>
(printout t "Add fuel." crlf))
(defrule r16
(fuel in tank yes)
=>
(printout t " Fuel leak (Yes/No)?" crlf)
(assert (fuel leak(read))))
(defrule r17
(fuel leak yes)
=>
(printout t "Need diagnostic test." crlf))
(defrule r18
(fuel leak no)
=>
(printout t "Check for any other leaks and try again." crlf))
(defrule r19
(belt ok no)
=>
(printout t "check if there is cracked belt (Yes/No)?" crlf)
(assert (cracked belt(read))))
(defrule r20
(cracked belt yes)
=>
(printout t "Mechanical distributor (Yes/No)?" crlf)
(assert (mechanical distributor(read))))
(defrule r21
(mechanical distributor yes)
=>
(printout t "Check condenser, magnetic pickup and rotor." crlf))
(defrule r22
(mechanical distributor no)
=>
(printout t "For electronic distribution, see model manual for diagnostic checks." crlf))
(defrule r23
(racked belt no)
=>
(printout t "Check it is 12V at coil primary (Yes/No)?" crlf)
(assert (coil primary(read))))
(defrule r24
(coil primary yes)
=>
(printout t "Check secondary output wire resistance." crlf))
(defrule r25
(coil primary no)
=>
(printout t "Check ignition system wiring and voltage regulator." crlf))
(defrule r26
(Key-fob-turns-to-run-and-hear-crank no)
=>
(printout t "starter runs (Yes/No)?" crlf)
(assert (starter runs(read))))
(defrule r27
(starter runs yes)
=>
(printout t "Not enough power to turn engine." crlf))
(defrule r28
(starter runs no)
=>
(printout t "Battery reads ok (Yes/No)?" crlf)
(assert (battery reads(read))))
(defrule r29
(battery reads yes)
=>
(printout t "Check if there is any corrosive terminals (yes/no)?" crlf)
(assert (corrosive terminals(read))))
(defrule r30
(corrosive terminals yes)
=>
(printout t "Clean terminals and retry." crlf))
(defrule r31
(corrosive terminals no)
=>
(printout t "Check terminals are connected properly and retry." crlf))
(defrule r32
(battery reads no)
=>
(printout t "Change battery." crlf))
从我的系统的 assignment1.clp 文件加载此规则后,它显示了这个。解决方案是什么?这是我的第一个任务,我找不到解决这个问题的可能性。我犯了什么错误请帮我解决这个问题
CLIPS (6.30 3/17/15)
CLIPS> (load "C:/Users/Archana/Desktop/AI/AI assignment 1.CLP")
Defining defrule: r1 +j+j
Defining defrule: r2 +j+j
Defining defrule: r3 +j+j
Defining defrule: r4 +j+j
Defining defrule: r5 +j+j
Defining defrule: r6 +j+j
Defining defrule: r7 +j+j
Defining defrule: r8 +j+j
Defining defrule: r9 +j+j
Defining defrule: r10 +j+j
Defining defrule: r11 +j+j
Defining defrule: r12 +j+j
Defining defrule: r13 +j+j
Defining defrule: r14 +j+j
Defining defrule: r15 +j+j
Defining defrule: r16 +j+j
Defining defrule: r17 +j+j
Defining defrule: r18 +j+j
Defining defrule: r19 +j+j
Defining defrule: r20 +j+j
Defining defrule: r21 +j+j
Defining defrule: r22 +j+j
Defining defrule: r23 +j+j
Defining defrule: r24 +j+j
Defining defrule: r25 +j+j
Defining defrule: r26 +j+j
Defining defrule: r27 +j+j
Defining defrule: r28 +j+j
Defining defrule: r29 +j+j
Defining defrule: r30 +j+j
Defining defrule: r31 +j+j
Defining defrule: r32 +j+j
[CSTRCPSR1] Expected the beginning of a construct.
FALSE
CLIPS>
由于您文件中的最后一条规则 r32 加载时没有错误,可能是该规则之后的某些内容导致了问题。它可能是一个不可见的字符,因此您可以尝试删除文件底部的任何多余行。另见 CLIPS "Expected the beginning of a construct", CLIPS Expected beginning of construct, and 。
这是解决汽车启动问题的专家系统。我在创建规则时犯了什么错误吗?我想要 5 种不同的输出。
(defrule r1
(Key-fob-turns-to-run-and-hear-crank yes)
=>
(printout t "Hear engine sound (Yes/No)?" crlf)
(assert (engine sound(read))))
(defrule r2
(engine sound yes)
=>
(printout t "If engine runs and stop after a while (Yes/No)?" crlf)
(assert (engine runs and stop(read))))
(defrule r3
(engine runs and stop no)
=>
(printout t "There is no fuel, low battery or other issues." crlf))
(defrule r4
(engine runs and stop yes)
=>
(printout t "Check if engine light is on (Yes/No)?" crlf)
(assert (engine light(read))))
(defrule r5
(engine light no)
=>
(printout t " Check for any other warning signs and take it to mechanic" crlf))
(defrule r6
(engine light yes)
=>
(printout t "Any service code (yes/no)?" crlf)
(assert (service code(read))))
(defrule r7
(service code yes)
=>
(printout t "Read code and fix the problem" crlf))
(defrule r8
(service code no)
=>
(printout t "Check if it stalls in rain (Yes/No)?" crlf)
(assert (stalls in rain(read))))
(defrule r9
(stalls in rain yes)
=>
(printout t "Check for cracked coil distributor" crlf))
(defrule r10
(stalls in rain no)
=>
(printout t "check if it stalls in warm (Yes/No)?" crlf)
(assert (stalls in warm(read))))
(defrule r11
(stalls in warm yes)
=>
(printout t "Adjust idle, blow out fuel filter." crlf)
(printout t "Check fuel pump output and check vaccum leak." crlf))
(defrule r12
(stalls in warm no)
=>
(printout t "ON cold stalling, check for stuck choke, EGR and check vaccum leak." crlf))
(defrule r13
(engine sound no)
=>
(printout t "check the belt is ok (Yes/No)?" crlf)
(assert (belt ok(read))))
(defrule r14
(belt ok yes)
=>
(printout t "Fuel in tank (Yes/No)?" crlf)
(assert (fuel in tank(read))))
(defrule r15
(fuel in tank no)
=>
(printout t "Add fuel." crlf))
(defrule r16
(fuel in tank yes)
=>
(printout t " Fuel leak (Yes/No)?" crlf)
(assert (fuel leak(read))))
(defrule r17
(fuel leak yes)
=>
(printout t "Need diagnostic test." crlf))
(defrule r18
(fuel leak no)
=>
(printout t "Check for any other leaks and try again." crlf))
(defrule r19
(belt ok no)
=>
(printout t "check if there is cracked belt (Yes/No)?" crlf)
(assert (cracked belt(read))))
(defrule r20
(cracked belt yes)
=>
(printout t "Mechanical distributor (Yes/No)?" crlf)
(assert (mechanical distributor(read))))
(defrule r21
(mechanical distributor yes)
=>
(printout t "Check condenser, magnetic pickup and rotor." crlf))
(defrule r22
(mechanical distributor no)
=>
(printout t "For electronic distribution, see model manual for diagnostic checks." crlf))
(defrule r23
(racked belt no)
=>
(printout t "Check it is 12V at coil primary (Yes/No)?" crlf)
(assert (coil primary(read))))
(defrule r24
(coil primary yes)
=>
(printout t "Check secondary output wire resistance." crlf))
(defrule r25
(coil primary no)
=>
(printout t "Check ignition system wiring and voltage regulator." crlf))
(defrule r26
(Key-fob-turns-to-run-and-hear-crank no)
=>
(printout t "starter runs (Yes/No)?" crlf)
(assert (starter runs(read))))
(defrule r27
(starter runs yes)
=>
(printout t "Not enough power to turn engine." crlf))
(defrule r28
(starter runs no)
=>
(printout t "Battery reads ok (Yes/No)?" crlf)
(assert (battery reads(read))))
(defrule r29
(battery reads yes)
=>
(printout t "Check if there is any corrosive terminals (yes/no)?" crlf)
(assert (corrosive terminals(read))))
(defrule r30
(corrosive terminals yes)
=>
(printout t "Clean terminals and retry." crlf))
(defrule r31
(corrosive terminals no)
=>
(printout t "Check terminals are connected properly and retry." crlf))
(defrule r32
(battery reads no)
=>
(printout t "Change battery." crlf))
从我的系统的 assignment1.clp 文件加载此规则后,它显示了这个。解决方案是什么?这是我的第一个任务,我找不到解决这个问题的可能性。我犯了什么错误请帮我解决这个问题
CLIPS (6.30 3/17/15)
CLIPS> (load "C:/Users/Archana/Desktop/AI/AI assignment 1.CLP")
Defining defrule: r1 +j+j
Defining defrule: r2 +j+j
Defining defrule: r3 +j+j
Defining defrule: r4 +j+j
Defining defrule: r5 +j+j
Defining defrule: r6 +j+j
Defining defrule: r7 +j+j
Defining defrule: r8 +j+j
Defining defrule: r9 +j+j
Defining defrule: r10 +j+j
Defining defrule: r11 +j+j
Defining defrule: r12 +j+j
Defining defrule: r13 +j+j
Defining defrule: r14 +j+j
Defining defrule: r15 +j+j
Defining defrule: r16 +j+j
Defining defrule: r17 +j+j
Defining defrule: r18 +j+j
Defining defrule: r19 +j+j
Defining defrule: r20 +j+j
Defining defrule: r21 +j+j
Defining defrule: r22 +j+j
Defining defrule: r23 +j+j
Defining defrule: r24 +j+j
Defining defrule: r25 +j+j
Defining defrule: r26 +j+j
Defining defrule: r27 +j+j
Defining defrule: r28 +j+j
Defining defrule: r29 +j+j
Defining defrule: r30 +j+j
Defining defrule: r31 +j+j
Defining defrule: r32 +j+j
[CSTRCPSR1] Expected the beginning of a construct.
FALSE
CLIPS>
由于您文件中的最后一条规则 r32 加载时没有错误,可能是该规则之后的某些内容导致了问题。它可能是一个不可见的字符,因此您可以尝试删除文件底部的任何多余行。另见 CLIPS "Expected the beginning of a construct", CLIPS Expected beginning of construct, and