Advertisement
Guest User

zmienne

a guest
Oct 22nd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. (defrule farbowanie
  2. ?i <- (osoba ?im blond ?ko)
  3. =>(retract ?i)
  4. (assert (osoba ?im czarne ?ko)))
  5.  
  6.  
  7. ;operacja zapisu na standardowe urzadzenie
  8. ;skladnia (printout t <arg1> <arg2> ...)
  9. ;t - arg. terminal (urzadzenie standardowe)
  10. ;<arg1>, <arg2> - parametry : stale,zmienne,wyrazenia,funkcje,predefiniowane (crlf)
  11.  
  12.  
  13. ;cykle
  14. (deffacts dane (lista a b))
  15. (defrule przestaw
  16. ?i <- (lista ?x ?y)
  17. => (retract ?i)
  18. (assert (nowa ?y ?x)))
  19.  
  20. ;(defrule jeszcze
  21. ;?i <- (nowa ?a ?b)
  22. ;=> (retract ?i)
  23. ;(assert (;;;;lista ?b ?a)))
  24.  
  25. ;ZMIENNE WIELOPOLOWE
  26. ;identyfikator
  27. ; $?<nazwa_symboliczna>
  28.  
  29. ;przyklad
  30. (deffacts listy
  31. (lista a b c))
  32. ;(lista a b)
  33. ;(lista a)
  34. ;(lista))
  35.  
  36. (defrule dowolna
  37. (lista $?cos1 $?cos2)
  38. => (printout t "zawiera: " $?cos1 $?cos2 crlf))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement