Guest User

Untitled

a guest
Jan 16th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. (deftemplate MAIN::person
  2. (slot name)
  3. (slot age)
  4. (multislot hobby)
  5. (slot town)
  6. (slot sex))
  7.  
  8. (person (name "Jane")
  9. (age 25)
  10. (hobby fashion gardening)
  11. (town montrose)
  12. (sex female))
  13.  
  14. (deffacts hobby_types "Hobby categories"
  15. (hobby_type gardening active)
  16. (hobby_type swinging active)
  17. (hobby_type reading inactive)
  18. (hobby_type fashion inactive)
  19. )
  20.  
  21. (defrule compatible_hobbies
  22. (opposite_sex ?name1 ?name2)
  23. (person (name ?name1) (hobby ?hobby1))
  24. (person (name ?name2) (hobby ?hobby2))
  25. (hobby_type ?hobby1 ?type)
  26. (hobby_type ?hobby2 ?type)
  27. =>
  28. (assert (hobbies_match ?name1 ?name2))
  29. )
Add Comment
Please, Sign In to add comment