Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Bash by dfasdf ( 14 years ago )
(defrule data-input
(initial-fact)
=>
(printout t crlf " Tip ustroistva mobilnoi svjazi: ")
(printout t crlf " 1 - Smartfon ")
(printout t crlf " 2 - Telefon " crlf)
(bind ?tip (read))
(assert (tip ?tip))
(printout t crlf " Funkcionalnost: ")
(printout t crlf " 1 - Tolko dlia zvonkov")
(printout t crlf " 2 - Optimalnoe sochetanie zvonkov i igr ")
(printout t crlf " 3 - Dlia igr/foto/video i dr " crlf)
(bind ?funkc (read))
(assert (funkc ?funkc))
(printout t crlf " Firma: ")
(printout t crlf " 1 - Nokia ")
(printout t crlf " 2 - HTC ")
(printout t crlf " 3 - Samsung ")
(printout t crlf " 4 - LG ")
(printout t crlf " 5 - Apple " crlf)
(bind ?firma (read))
(assert (firma ?firma))
(printout t crlf "Max stoimost ustroistva: ")
(bind ?cash (read))
(assert (cash ?cash))
)
(defrule R1
(funkc ?funkc)
(firma ?firma)
(test (and (= ?funkc 1)(= ?firma 1)) )
=>
(printout t crlf crlf "Vi vibrali klassik firmi Nokia" crlf)
(assert (type Klassik Nokia))
(assert (typecnst 1)))
(defrule R2
(funkc ?funkc)
(firma ?firma)
(test (and (= ?funkc 1)(= ?firma 2)) )
=>
(printout t crlf crlf "Vi vibrali klassik firmi HTC " crlf)
(assert (type Klassik HTC))
(assert (typecnst 2)))
(defrule R3
(funkc ?funkc)
(firma ?firma)
(test (and (= ?funkc 1)(= ?firma 3)) )
=>
(printout t crlf crlf "Vi vibrali klassik firmi Samsung " crlf)
(assert (type Klassik Samsung))
(assert (typecnst 3)))
(defrule R4
(funkc ?funkc)
(firma ?firma)
(test (and (= ?funkc 1)(= ?firma 4)) )
=>
(printout t crlf crlf "Vi vibrali klassik firmi LG " crlf)
(assert (type Klassik LG))
(assert (typecnst 4)))
(defrule R5
(funkc ?funkc)
(firma ?firma)
(tip ?tip)
(test (and (= ?funkc 1)(= ?firma 5)(= ?tip 1)) )
=>
(printout t crlf crlf "Vi vibrali klassik firmi Apple " crlf)
(assert (type Klassik Apple))
(assert (typecnst 5)))
(defrule R5_1
(funkc ?funkc)
(firma ?firma)
(tip ?tip)
(test (and (= ?funkc 1)(= ?firma 5)(= ?tip 2)) )
=>
(printout t crlf crlf "Telefoni dannoi firmi ne proizvodjatsja" crlf)
(assert (config Viberete drugie parametri)))
(defrule R6
(funkc ?funkc)
(firma ?firma)
(test (and (= ?funkc 2)(= ?firma 1)) )
=>
(printout t crlf crlf "Vi vibrali optim firmi Nokia" crlf)
(assert (type Optim Nokia))
(assert (typecnst 6)))
(defrule R7_1
(funkc ?funkc)
(firma ?firma)
(test (and (= ?funkc 2)(= ?firma 2)) )
=>
(printout t crlf crlf "Telefoni dannoi firmi ne proizvodjatsja" crlf)
(assert (config Viberete drugie parametri)))
(defrule R7
(funkc ?funkc)
(firma ?firma)
(test (and (= ?funkc 2)(= ?firma 3)) )
=>
(printout t crlf crlf "Vi vibrali optim firmi Samsung " crlf)
(assert (type Optim Samsung))
(assert (typecnst 7)))
(defrule R8
(funkc ?funkc)
(firma ?firma)
(test (and (= ?funkc 2)(= ?firma 4)) )
=>
(printout t crlf crlf "Vi vibrali optim firmi LG " crlf)
(assert (type Optim LG))
(assert (typecnst 8)))
(defrule R8_1
(funkc ?funkc)
(firma ?firma)
(test (and (> ?funkc 1)(= ?firma 5)) )
=>
(printout t crlf crlf "Telefoni dannoi firmi ne proizvodjatsja" crlf)
(assert (config Viberete drugie parametri)))
(defrule R9
(funkc ?funkc)
(firma ?firma)
(test (and (= ?funkc 3)(= ?firma 1)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi firmi Nokia " crlf)
(assert (type Igrovoi Nokia))
(assert (typecnst 9)))
(defrule R10
(funkc ?funkc)
(firma ?firma)
(test (and (= ?funkc 3)(= ?firma 2)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi firmi HTC " crlf)
(assert (type Igrovoi HTC))
(assert (typecnst 10)))
(defrule R11
(funkc ?funkc)
(firma ?firma)
(test (and (= ?funkc 3)(= ?firma 3)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi firmi Samsung " crlf)
(assert (type Igrovoi Samsung))
(assert (typecnst 11)))
(defrule R12
(funkc ?funkc)
(firma ?firma)
(test (and (= ?funkc 3)(= ?firma 4)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi firmi LG " crlf)
(assert (type "Igrovoi LG"))
(assert (typecnst 12)))
(defrule R13
(tip ?tip)
(cash ?cash)
(test (and (= ?tip 2)(and(>= ?cash 1000)(<= ?cash 4000))) )
=>
(printout t crlf crlf "Deshevii telefon" crlf)
(assert (money Nizkaja cena))
(assert (moneycnst 1)))
(defrule R14
(tip ?tip)
(cash ?cash)
(test (and (<= ?tip 2)(and(> ?cash 4000)(<= ?cash 10000))) )
=>
(printout t crlf crlf "Horoshii telefon/smartfon" crlf)
(assert (money Srednija cena))
(assert (moneycnst 2)))
(defrule R15
(tip ?tip)
(cash ?cash)
(test (and (= ?tip 1)(and(>= ?cash 10000)(<= ?cash 20000))) )
=>
(printout t crlf crlf "Otlichnij smartfon" crlf)
(assert (money Visokaja cena))
(assert (moneycnst 3)))
(defrule R15_1
(tip ?tip)
(cash ?cash)
(or(test (and (= ?tip 2)(and(>= ?cash 10000)(<= ?cash 20000))) )
(test (and (= ?tip 1)(and(>= ?cash 1000)(<= ?cash 4000))) ) )
=>
(printout t crlf crlf "Telefonov dannoi sborki po dannoi cene net" crlf))
(defrule R16
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 1)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij telefon Nokia po nizkoi cene." crlf)
(printout t crlf crlf "Nokia C3:
Platforma Series 40
QWERTY est
Upravlenie navigacionnaja klavisha
Ves 114 g
Razmer 58x116x14 mm" crlf)
(assert (config Klassik telefon Nokia deshevii)))
(defrule R17
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 2)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij telefon HTC po nizkoi cene." crlf)
(printout t crlf crlf "Telefonov dannoi sborki po deshevoi cene net" crlf)
(assert (config Klassik telefon HTC deshevii)))
(defrule R18
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 3)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij telefon Samsung po nizkoi cene." crlf)
(printout t crlf crlf "Samsung S3350:
QWERTY est
Upravlenie navigacionnaja klavisha
Ves 93 g
Razmer 61x111x12 mm" crlf)
(assert (config Klassik telefon Samsung deshevii)))
(defrule R19
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 4)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij telefon LG po nizkoi cene." crlf)
(printout t crlf crlf "LG t300:
Ves 75 g
Razmer 51x94x13 mm " crlf)
(assert (config Klassik telefon LG deshevii)))
(defrule R20
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 5)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij smartfon Apple po nizkoi cene." crlf)
(printout t crlf crlf "Telefonov dannoi sborki po deshevoi cene net" crlf)
(assert (config Klassik smartfon Apple deshevii)))
(defrule R21
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 6)) )
=>
(printout t crlf crlf "Vi vibrali optimalnij telefon Nokia po nizkoi cene." crlf)
(printout t crlf crlf "Nokia 6131:
Platforma Series 40
Material plastic
Upravlenie navigacionnaja klavisha
Ves 102 g
Razmer 48x92x20 mm" crlf)
(assert (config Optim telefon Nokia deshevii)))
(defrule R22
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 7)) )
=>
(printout t crlf crlf "Vi vibrali optimalnij telefon Samsung po nizkoi cene." crlf)
(printout t crlf crlf "Samsung c3520:
Material plastic
Upravlenie navigacionnaja klavisha
Uroven SAR 0.355
Ves 97 g
Razmer 52x102x16.78 mm" crlf)
(assert (config Optim telefon Samsung deshevii)))
(defrule R23
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 8)) )
=>
(printout t crlf crlf "Vi vibrali optimalnij telefon LG po nizkoi cene." crlf)
(printout t crlf crlf "LG A258:
Material plastic
Upravlenie navigacionnaja klavisha
Razmer 49.1x97.5x16.7 mm" crlf)
(assert (config Optim telefon LG deshevii)))
(defrule R24
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 9)) )
=>
(printout t crlf crlf "Vi vibrali optimalnij telefon Nokia po nizkoi cene." crlf)
(printout t crlf crlf "Nokia C2-05:
Platforma Series 40
Upravlenie navigacionnaja klavisha
Ves 98 g
Razmer 47.8x99.4x16.3 mm" crlf)
(assert (config Igrovoi telefon Nokia deshevii)))
(defrule R25
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 10)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi telefon HTC po nizkoi cene." crlf)
(printout t crlf crlf "Telefonov dannoi sborki po deshevoi cene net" crlf)
(assert (config Igrovoi telefon HTC deshevii)))
(defrule R26
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 11)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi telefon Samsung po nizkoi cene." crlf)
(printout t crlf crlf "Samsung C3752:
Upravlenie navigacionnaja klavisha
Poddergka 2 sim-kart
Ves 92 g
Razmer 49x98x16 mm" crlf)
(assert (config Igrovoi telefon Samsung deshevii)))
(defrule R27
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 12)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi telefon LG po nizkoi cene." crlf)
(printout t crlf crlf "Telefonov dannoi sborki po deshevoi cene net" crlf)
(assert (config Igrovoi telefon LG deshevii)))
(defrule R28
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 2)(= ?typecnst 1)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij smartfon Nokia po srednei cene." crlf)
(printout t crlf crlf "Nokia Lumia 710:
OS MS Windows Phone 7.5
Material plastic
Ves 126 g
Razmer 62.4x119x12.5 mm" crlf)
(assert (config Klassik smartfon Nokia srednii)))
(defrule R29
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 2)(= ?typecnst 2)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij smartfon HTC po srednei cene." crlf)
(printout t crlf crlf "HTC Wildfire S:
OS Android 2.3
Material plastic
Ves 105 g
Razmer 59x101x12 mm" crlf)
(assert (config Klassik smartfon HTC srednii)))
(defrule R30
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 2)(= ?typecnst 3)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij smartfon Samsung po srednei cene." crlf)
(printout t crlf crlf "Samsung Galaxy Gio S5660:
OS Android 2.2
Material plastic
Ves 102 g
Razmer 58x111x12 mm" crlf)
(assert (config Klassik smartfon Samsung srednii)))
(defrule R31
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 2)(= ?typecnst 4)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij telefon LG po srednei cene." crlf)
(printout t crlf crlf "LG GX500:
Material plastic
Poddergka 2 sim-kart
Ves 118 g
Razmer 53x109x13 mm" crlf)
(assert (config Klassik telefon LG srednii)))
(defrule R32
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 2)(= ?typecnst 5)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij smartfon Apple po srednei cene." crlf)
(printout t crlf crlf "Apple iPhone 3G:
Platforma iOS
Material plastic
Ves 133 g
Razmer 62x115x12 mm" crlf)
(assert (config Klassik smartfon Apple srednii)))
(defrule R33
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 2)(= ?typecnst 6)) )
=>
(printout t crlf crlf "Vi vibrali optimalnij telefon Nokia po srednei cene." crlf)
(printout t crlf crlf "Nokia N76:
Platforma Series 60
Upravlenie navigacionnaja klavisha
Ves 115 g
Razmer 52x107x14 mm" crlf)
(assert (config Optim telefon Nokia srednii)))
(defrule R34
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 2)(= ?typecnst 7)) )
=>
(printout t crlf crlf "Vi vibrali optimalnij telefon Samsung po srednei cene." crlf)
(printout t crlf crlf "Telefonov dannoi sborki po srednei cene net" crlf)
(assert (config Optim telefon Samsung srednii)))
(defrule R35
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 2)(= ?typecnst 8)) )
=>
(printout t crlf crlf "Vi vibrali optimalnij telefon LG po srednei cene." crlf)
(printout t crlf crlf "LG KG225:
Upravlenie navigacionnaja klavisha
Ves 70 g
Razmer 45x85x22 mm" crlf)
(assert (config Optim telefon LG srednii)))
(defrule R36
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 2)(= ?typecnst 9)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi smartfon Nokia po srednei cene." crlf)
(printout t crlf crlf "Nokia C6-00:
Platforma Series 60
OS Symbian OS 9.4
QWERTY est
Ves 150 g
Razmer 53x113x17 mm" crlf)
(assert (config Igrovoi smartfon Nokia srednii)))
(defrule R37
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 2)(= ?typecnst 10)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi smartfon HTC po srednei cene." crlf)
(printout t crlf crlf "Telefonov dannoi sborki po srednei cene net" crlf)
(assert (config Igrovoi smartfon HTC srednii)))
(defrule R38
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 2)(= ?typecnst 11)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi telefon Samsung po srednei cene." crlf)
(printout t crlf crlf "Samsung C3752:
Upravlenie navigacionnaja klavisha
Poddergka 2 sim-kart
Ves 92 g
Razmer 49x98x16 mm" crlf)
(assert (config Igrovoi telefon Samsung srednii)))
(defrule R39
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 2)(= ?typecnst 12)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi smartfon LG po srednei cene." crlf)
(printout t crlf crlf "LG GW620:
OS Android 1.5
Material plastic
QWERTY est
Upravlenie navigacionnaja klavisha
Uroven SAR 0.64
Ves 139 g
Razmer 55x109x16 mm" crlf)
(assert (config Igrovoi smartfon LG srednii)))
(defrule R40
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 3)(= ?typecnst 1)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij smartfon Nokia po visokoi cene." crlf)
(printout t crlf crlf "Nokia Lumia 800:
OS MS Windows Phone 7.5
Ves 142 g
Razmer 61.2x116.5x12.1 ìì" crlf)
(assert (config Klassik smartfon Nokia dorogoi)))
(defrule R41
(typecnst ?typecnst)
(money ?moneycnst)
(test (and (= ?moneycnst 3)(= ?typecnst 2)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij smartfon HTC po visokoi cene." crlf)
(printout t crlf crlf "HTC Incredible S:
OS Android 2.2
Material metal i plastic
Ves 136 g
Razmer 64x120x11.7 mm" crlf)
(assert (config Klassik smartfon HTC dorogoi)))
(defrule R42
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 3)(= ?typecnst 3)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij smartfon Samsung po visokoi cene." crlf)
(printout t crlf crlf "Samsung Galaxy S II I9100:
OS Android 2.3
Ves 116 g
Razmer 66.1x125.3x8.49 mm" crlf)
(assert (config Klassik smartfon Samsung dorogoi)))
(defrule R43
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 3)(= ?typecnst 4)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij smartfon LG po visokoi cene." crlf)
(printout t crlf crlf "LG Optimus Black P970:
OS Android 2.2
Material plastic
Ves 109 g
Razmer 64x122x9 mm" crlf)
(assert (config Klassik smartfon LG dorogoi)))
(defrule R44
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 3)(= ?typecnst 5)) )
=>
(printout t crlf crlf "Vi vibrali klassicheskij smartfon Apple po visokoi cene." crlf)
(printout t crlf crlf "Apple iPhone 4S:
OS iOS 5
Material stal i steklo
Ves 140 g
Razmer 58.6x115.2x9.3 mm" crlf)
(assert (config Klassik smartfon Apple dorogoi)))
(defrule R45
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 3)(= ?typecnst 6)) )
=>
(printout t crlf crlf "Vi vibrali optimalnij smartfon Nokia po visokoi cene." crlf)
(printout t crlf crlf "Nokia E90:
Platforma Series 60
OS Symbian OS 9.2
QWERTY est
Upravlenie navigacionnaja klavisha
Ves 210 g
Razmer 57x132x20 mm" crlf)
(assert (config Optim smartfon Nokia dorogoi)))
(defrule R46
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 7)) )
=>
(printout t crlf crlf "Vi vibrali optimalnij smartfon Samsung po visokoi cene." crlf)
(printout t crlf crlf "Telefonov dannoi sborki po visokoi cene net" crlf)
(assert (config Optim smartfon Samsung dorogoi)))
(defrule R47
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 8)) )
=>
(printout t crlf crlf "Vi vibrali optimalnij smartfon LG po visokoi cene." crlf)
(printout t crlf crlf "Telefonov dannoi sborki po visokoi cene net" crlf)
(assert (config Optim smartfon LG dorogoi)))
(defrule R48
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 9)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi smartfon Nokia po visokoi cene." crlf)
(printout t crlf crlf "Nokia E7:
Platforma Symbian
OS Nokia Belle
Marerial aluminii
QWERTY est
Ves 176 g
Razmer 62x124x14 mm" crlf)
(assert (config Igrovoi smartfon Nokia dorogoi)))
(defrule R49
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 10)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi smartfon HTC po visokoi cene." crlf)
(printout t crlf crlf "HTC 7 Pro:
OS MS Windows Phone 7
QWERTY est
Ves 185 g
Razmer 59x117.5x15.5 mm" crlf)
(assert (config Igrovoi smartfon HTC dorogoi)))
(defrule R50
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 11)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi smartfon Samsung po visokoi cene." crlf)
(printout t crlf crlf "Telefonov dannoi sborki po visokoi cene net" crlf)
(assert (config Igrovoi smartfon Samsung dorogoi)))
(defrule R51
(typecnst ?typecnst)
(moneycnst ?moneycnst)
(test (and (= ?moneycnst 1)(= ?typecnst 12)) )
=>
(printout t crlf crlf "Vi vibrali igrovoi smartfon LG po visokoi cene." crlf)
(printout t crlf crlf "Telefonov dannoi sborki po visokoi cene net" crlf)
(assert (config Igrovoi smartfon LG dorogoi)))
Revise this Paste