;rule 2:
;=========================
(defrule chk_ip ""
(type_network(number ?number& 1))
=>
(printout t "start - control panel - network and sharing"crlf
"check ip have ?(y or n)")
(bind ?type ip(read))
(assert (check_ip(type ip ?ip)))
)
;rule 8:
;=============================
(defrule chk_NIC ""
(check_driver(type driver ?driver& y))
=>
(printout t crlf crlf crlf "start - control panel - devise and printers - device manager"crlf
"check kon NIC ?(y/n)")
(bind ?typeNIC(read))
(assert (check_NIC(type NIC ?NIC)))
)
;rule 9:
;=================================
(defrule nocheck_NIC ""
(check_NIC(typeNIC(type NIC ?NIC&n))
=>
(printout t crlf crlf" NIC is disabale"))
)
;rule 10:
;===================================
(defrule chk_set ""
(check_NIC(type NIC ?NIC& y)
=>
(printout t crlf crlf crlf "start - control panel - device and printers - device manager")crlf
"check kon network ?(y/n)")
(bind ?typeset(read))
(assert (check_setnet(type set ?set)))
)
;rule 11:
;=====================================
(defrul chk_set ""
(check_setnet(type set ?set& n))
=>
(printout t crlf crlf "device is disable")
)
;rule 12:
;======================================
(defrule chk_fire ""
(type_problem(type set ?type set& y))
=>
(printout t crlf"start - control panel - windows firewall"crlf
"check windows firewall is it on?(y or no)" )
(bind ?typefire (read))
(assert (ck_fire(type fire ?fire)))
)
;rule 13:
;====================================
(defrule on_fire
(ck_fire(type fire ?fire& y)) ""
=>
(printout t crlf " please off windows firewall and if your problem still countinu please reapeat program"crlf))
;rule 14:
;===================================
(defrule off_fire
(ck_fire(type fire ?fire& n)) ""
=>
(printout t "start - run - cmd - ping server ip"crlf"do you have ping ?(y or n):")
(bind ?typenet (read))
(assert (ck_set(type set ?type set)))
)
;rule 15:
;=====================================
(defrule chk_set
(type set ?set& y) ""
=>
(printout t crlf crlf crlf "Start - Control panel - Network - My network place"crlf
"resorce darim(y/n)")
(bind ?typeresource)
(assert (check_resorce(type resource ?reorce)))
)
where is the Problem?
;DEFTAMPLATE
;=============================
(deftamplate type_network(field ?number )
(slot check_ip(type ip))
(slot check_ping(type ping))
(slot check_name(type name))
(slot check_address(type address))
(slot check_driver(type driver))
(slot check_NIC(type NIC))
(slot check_setnet(type set))
(slot check_fire(type fire))
(slot check_source(type source))
)
;rule 1:
;=======================
(defrule basic ""
=>
(printout t "what is problem(software , hardware)? " crlf
"1:Ip nadarim ?" crlf
"2:etesal ghat mibashad ?" crlf
"3:exit" crlf
"choose 1-3 ->")
(bind ?number(read))
(assert (type_network(number ?number)))
)
;rule 2:
;=========================
(defrule chk_ip ""
(type_network(number ?number& 1))
=>
(printout t "start - control panel - network and sharing"crlf
"check ip have ?(y or n)")
(bind ?type ip(read))
(assert (check_ip(type ip ?ip)))
)
;rule 3:
(defrule chk_ping ""
(check_ip(typeip ?typeip& y))
=>
(printout t "start - run - cmd - ping www.google.com" crlf
"reply bood?(y/n)") crlf
(bind ?type ping(read))
(assert (check_ping(type ping ?ping)))
)
;rule 4:
;===========================
(defrule chk_name ""
(check_ping(type ping ?ping& y))
=>
(printout t crlf crlf crlf "roye my Computer rast click nemude,spas ghesmate propertist=>change setting =>tabe computername =>gozineye change =>name Workgroup ra taein mikonim"crlf
"workgroupe in system ba mabaghi,barabar bood ?(y/n)")
(bind ?type name(read))
(assert (check_name(type name ?name)))
)
;rule 5:
;===========================
(defrule chk_address ""
(check_name(type name ?type name& y))
=>
(printout t crlf crlf crlf "start - run - cmd - getmac"crlf
"check kon mac address?(y/n)")
(bind ?typeaddress(read))
(assert (check_address(type address ?address)))
)
;rule 6:
;============================
(defrule chk_driver ""
(check_address(type address ?address& y))
=>
(printout t crlf crlf crlf"start - control panel - divice and printer - divice manager"crlf
"check kon driver?(y/n)")
(bind ?typedriver(read))
(assert (check_driver(type driver ?driver)))
)
;rule 7:
;=============================
(defrule nochk_driver ""
(check_driver(type driver ?driver& n))
=>
(printout t crlf crlf crlf "not found")
)
;rule 8:
;=============================
(defrule chk_NIC ""
(check_driver(type driver ?driver& y))
=>
(printout t crlf crlf crlf "start - control panel - devise and printers - device manager"crlf
"check kon NIC ?(y/n)")
(bind ?typeNIC(read))
(assert (check_NIC(type NIC ?NIC)))
)
;rule 9:
;=================================
(defrule nocheck_NIC ""
(check_NIC(typeNIC(type NIC ?NIC&n))
=>
(printout t crlf crlf" NIC is disabale"))
)
;rule 10:
;===================================
(defrule chk_set ""
(check_NIC(type NIC ?NIC& y)
=>
(printout t crlf crlf crlf "start - control panel - device and printers - device manager")crlf
"check kon network ?(y/n)")
(bind ?typeset(read))
(assert (check_setnet(type set ?set)))
)
;rule 11:
;=====================================
(defrul chk_set ""
(check_setnet(type set ?set& n))
=>
(printout t crlf crlf "device is disable")
)
;rule 12:
;======================================
(defrule chk_fire ""
(type_problem(type set ?type set& y))
=>
(printout t crlf"start - control panel - windows firewall"crlf
"check windows firewall is it on?(y or no)" )
(bind ?typefire (read))
(assert (ck_fire(type fire ?fire)))
)
;rule 13:
;====================================
(defrule on_fire
(ck_fire(type fire ?fire& y)) ""
=>
(printout t crlf " please off windows firewall and if your problem still countinu please reapeat program"crlf))
;rule 14:
;===================================
(defrule off_fire
(ck_fire(type fire ?fire& n)) ""
=>
(printout t "start - run - cmd - ping server ip"crlf"do you have ping ?(y or n):")
(bind ?typenet (read))
(assert (ck_set(type set ?type set)))
)
;rule 15:
;=====================================
(defrule chk_set
(type set ?set& y) ""
=>
(printout t crlf crlf crlf "Start - Control panel - Network - My network place"crlf
"resorce darim(y/n)")
(bind ?typeresource)
(assert (check_resorce(type resource ?reorce)))
)
;rule 16:
;======================================
(defrule chk_resource(check_reource(type resource ?resorce)) ""
=>
(printout t crlf crlf"no resource"crlf)
)
Lots of syntax errors. It's hard to tell whether you're trying to create multiple facts or embed facts within other facts.
;DEFTAMPLATE
;=============================
(deftemplate type_network
(slot number )
(slot check_ip)
(slot check_ping)
(slot check_name)
(slot check_address)
(slot check_driver)
(slot check_NIC)
(slot check_setnet)
(slot check_fire)
(slot check_source)
)
;rule 1:
;=======================
(defrule basic ""
=>
(printout t "what is problem(software , hardware)? " crlf
"1:Ip nadarim ?" crlf
"2:etesal ghat mibashad ?" crlf
"3:exit" crlf
"choose 1-3 ->")
(bind ?number(read))
(assert (type_network(number ?number)))
)
;rule 2:
;=========================
(defrule chk_ip ""
?f <- (type_network (number ?number& 1) (check_ip ~n&~y))
=>
(printout t "start - control panel - network and sharing"crlf
"check ip have ?(y or n)")
(bind ?type_ip (read))
(modify ?f (check_ip ?type_ip)))