Листинг ис файл (iis_it_frulle.Clp)
(defrule WisN
(initial-fact)
=>
(printout t crlf crlf)
(printout t ******************** crlf)
(printout t "* IIS COMPUTER DIAGNOSTICS *" crlf)
(printout t ******************** crlf)
(printout t crlf crlf)
(printout t "Dobrii den, kak mne k vam obrashatsya?" crlf)
(bind ?*name_user* (read))
(ask-hello "Chem mogu bit polezen, uvazhemii " ?*name_user*)
(assert(v1))
)
(defrule prav1
(v1)
=>
(if (ask-yes-no "U vas problemi s computerom? ")
then
(assert (v2))
else
(assert (v3))
)
)
(defrule prav3
(v3)
=>
(if (ask-yes-no "Nu raz u vas net problem s computerom, to mne pora... Vi hotite viite iz programmi? ")
then
(exit)
else
(reset)
(run)
)
)
(defrule prav2
(v2)
=>
(printout t "Kakaya u vas model computera?" crlf)
(bind ?name_computer (readline))
(create-object-user-pc ?name_computer)
(printout t "Kto proizvoditel computera?" crlf)
(bind ?name_producer (readline))
(create-object-user-producer ?name_producer)
(printout t "Kakay OS na vashem pc?" crlf)
(bind ?u_os (readline))
(if (ask-yes-no "Zapuskaetsya li operacionnay systema?")
then
(bind ?u_os_is_work TRUE)
else
(bind ?u_os_is_work FALSE)
)
(if (ask-yes-no "Podvisayet li operacionnay systema?")
then
(bind ?u_os_is_freezes TRUE)
else
(bind ?u_os_is_freezes FALSE)
)
(create-object-user-os ?u_os ?u_os_is_freezes ?u_os_is_work)
(assert (v14))
(assert (v15))
(assert (v16))
(assert (v24))
)
(defrule prav4
(v4)
=>
(if (ask-yes-no "Est li problemi v systemnom bloke?")
then
(assert (v5))
else
(assert (v7))
)
)
(defrule prav7
(v7)
=>
(printout t "Nadeys ya moi soveti pomogut vam" crlf)
(if (ask-yes-no "Nu raz u vas net problem s computerom, to mne pora... Vi hotite viite iz programmi? ")
then
(exit)
else
(reset)
(run)
)
)
(defrule prav5
(v5)
=>
(if (ask-yes-no "Est li problemi s CPU?")
then
(assert (v17))
(assert (v8))
else
(assert (v8))
)
)
(defrule prav8
(v8)
=>
(if (ask-yes-no "Est li problemi s DVD ROM?")
then
(assert (v18))
(assert (v9))
else
(assert (v9))
)
)
(defrule prav9
(v9)
=>
(if (ask-yes-no "Est li problemi s Zhestkim diskom?")
then
(assert (v19))
(assert (v10))
else
(assert (v10))
)
)
(defrule prav10
(v10)
=>
(if (ask-yes-no "Est li problemi s materinskoi platoi?")
then
(assert (v20))
(assert (v11))
else
(assert (v11))
)
)
(defrule prav11
(v11)
=>
(if (ask-yes-no "Est li problemi s operativnoi pamyaty?")
then
(assert (v21))
(assert (v12))
else
(assert (v12))
)
)
(defrule prav12
(v12)
=>
(if (ask-yes-no "Est li problemi s video kartoi?")
then
(assert (v22))
(assert (v13))
else
(assert (v23))
)
)
(defrule prav13
(v8)
(v9)
(v10)
(v11)
(v12)
(v17)
(v18)
(v19)
(v20)
(v21)
(v22)
=>
(printout t "***Uvazhaemii " ?*name_user* crlf)
(printout t "***Moi vam sovet kak specialista kupite novii komputer***" crlf)
))
(defrule prav14
(v14)
(object (name [u_os]) (is_freezes TRUE) (is_work FALSE))
=>
(printout t "***Uvazhaemii " ?*name_user* crlf)
(printout t "***Moi sovet vam pereustnovit sistemy***" crlf)
(assert (v15))
(assert (v4))
))
(defrule prav15
(v15)
(object (name [u_os]) (is_freezes TRUE) (is_work TRUE))
=>
(printout t "***Uvazhaemii " ?*name_user* crlf)
(printout t "***Moi sovet vam pochistite reestr i udality vremennie faili***" crlf)
(assert (v16))
(assert (v4))
))
(defrule prav16
(v16)
(object (name [u_os]) (is_freezes FALSE) (is_work TRUE))
=>
(printout t "***Uvazhaemii " ?*name_user* crlf)
(printout t "***Issleduem problemu dalshe***" crlf)
(assert (v4))
))
(defrule prav24
(v24)
(object (name [u_os]) (is_freezes FALSE) (is_work FALSE))
=>
(printout t "***Uvazhaemii " ?*name_user* crlf)
(printout t "***Moi sovet vam pereustnovit sistemy, s polnim formatirovaniem systimnih diskov***" crlf)
(assert (v4))
))
(defrule prav17
(v8)
(v17)
=>
(printout t "***Uvazhaemii " ?*name_user* "***" crlf)
(printout t "***Vi mozhete sminit proceesor, nuznho uchitivat model materinskoi plati pri zamene***" crlf)
(printout t "-------------- Neskolko sovetov --------------" crlf)
(printout t "***1) kupit dopolnitelnii kuler dlya ohlazhdeniya komputera***" crlf)
(printout t "***2) prochistit komputer ot pili i processor v tom chisle***" crlf)
(printout t "***3) smazat tonkim sloem termo pasti poverhnost processora, esli staray visohla***" crlf)
)
(defrule prav18
(v9)
(v18)
=>
(printout t "***Uvazhaemii " ?*name_user* "***" crlf)
(printout t "***Vi mozhete sminit dvd-rom***" crlf)
(printout t "-------------- Neskolko sovetov --------------" crlf)
(printout t "***1) nuzhno provesti podrobnuy diognostiku v servise***" crlf)
(printout t "***2) esli vozmozhno akkuratno razobrat i proteret spirtom scitivayshuy golovku***" crlf)
(printout t "***3) esli komputer ne opredelyaet dvd-rom no vi uvereni chto on rabotaet, vozmozhno nuzhno pomenyat mesto dzhampera***" crlf)
)
(defrule prav19
(v10)
(v19)
=>
(printout t "***Uvazhaemii " ?*name_user* "***" crlf)
(printout t "***Vi mozhete sminit zhestkii disk***" crlf)
(printout t "-------------- Neskolko sovetov --------------" crlf)
(printout t "***1) pri peregrevah nuzhno postavit kuler na zhestkii disk***" crlf)
(printout t "***2) esli komputer ne opredelyat zhestkii disk, proverit na drugom PC ili otnesti v servis,vozmozhno sbilas razmetka***" crlf)
(printout t "***3) otkroiti dispether zadach pri bolshoi nagruzk na zhestkii disk, vam nuzhno sdelat defragmentaciy diska***" crlf)
)
(defrule prav20
(v11)
(v20)
=>
(printout t "***Uvazhaemii " ?*name_user* "***" crlf)
(printout t "***Materinskuy platu v PC, ne tak prosto zamenit***" crlf)
(printout t "-------------- Neskolko sovetov --------------" crlf)
(printout t "***1) esli u vas ne rabotayt ustroystvo Vvoda, to skorei vsego nuzhno zamenit yzhnii most na materinskoi plete v srvise***" crlf)
(printout t "***2) esli ne rabotayt ustroistva vivoda to delo v severnom moste materinskoi plate, nuzhno zamenit***" crlf)
(printout t "***3) vozmozhno nuzhno pochistit ot pili***" crlf)
)
(defrule prav21
(v12)
(v21)
=>
(printout t "***Uvazhaemii " ?*name_user* "***" crlf)
(printout t "***Pri sgoranii RAM, ee legko zamenit***" crlf)
(printout t "-------------- Neskolko sovetov --------------" crlf)
(printout t "***1) esli komputer ne oprdelyet RAM, sleduet proverit vozmohnosti OS, i uchitivat chastotu i pamyat oni dolzhni bit odinakovi pri neskolkih lineikah RAM***" crlf)
(printout t "***2) proverit plotno li vstavlenna lineika RAM***" crlf)
(printout t "***3) ubeditsy, chto model lineiki RAM sovmestima s materinskoi platoi***" crlf)
)
(defrule prav22
(v13)
(v22)
=>
(printout t "***Uvazhaemii " ?*name_user* "***" crlf)
(printout t "***Pri sgoranii video carta, ee mozhno zamenit, esli ona ne vstroena v materinsku platu***" crlf)
(printout t "-------------- Neskolko sovetov --------------" crlf)
(printout t "***1) esli izobrazhenie iskazhennoe to sleduet proverit cabel podclucheniya k monitoru***" crlf)
(printout t "***2) esli video carta rabotaet normalno pri vklychenii, a zatem izobrazhenie iskazhaetsa, to sleduet postavit kuler na video cartu***" crlf)
(printout t "***3) esli video carta ne rabotaet, to sleduet otnesti ee v servis ili proverit na drugom PC***" crlf)
)
(defrule prav23
(v23)
=>
(printout t "***Uvazhaemii " ?*name_user* "***" crlf)
(if (ask-yes-no "Vi hotite viite iz programmi? ")
then
(exit)
else
(reset)
(run)
)
)