fork download
  1. (printout t "Noman Youaf" crlf)
  2. (printout t "Event Management System" crlf)
  3.  
  4. ; Define the fact template for Events
  5. (deftemplate Events
  6. (slot Event_name)
  7. (slot Event_date)
  8. (slot Start_time)
  9. (slot End_time)
  10. (slot Venue))
  11.  
  12. ; Add facts to the template
  13. (assert (Events
  14. (Event_name "Tech Conference 2025")
  15. (Event_date "2025-01-05")
  16. (Start_time "09:00 AM")
  17. (End_time "5:00 PM")
  18. (Venue "Malik Hall")))
  19.  
  20. (assert (Events
  21. (Event_name "Cultural Festival")
  22. (Event_date "2025-01-25")
  23. (Start_time "3:00 PM")
  24. (End_time "10:00 PM")
  25. (Venue "Hockey Ground, Main City")))
  26.  
  27. (assert (Events
  28. (Event_name "Education Expo")
  29. (Event_date "2025-02-05")
  30. (Start_time "10:00 AM")
  31. (End_time "4:00 PM")
  32. (Venue "Exam Hall, University")))
  33.  
  34. ; Print all events
  35. (printout t "All Events:" crlf)
  36.  
  37. ; Use do-for-all-facts to iterate over all Events facts and print them
  38. (do-for-all-facts ((?e Events))
  39. (printout t "Event Name: " (fact-slot-value ?e Event_name) crlf)
  40. (printout t "Event Date: " (fact-slot-value ?e Event_date) crlf)
  41. (printout t "Start Time: " (fact-slot-value ?e Start_time) crlf)
  42. (printout t "End Time: " (fact-slot-value ?e End_time) crlf)
  43. (printout t "Venue: " (fact-slot-value ?e Venue) crlf)
  44. (printout t "-----------------------------------" crlf)
  45. )
  46.  
  47. ; Exit the program
  48. (exit)
  49.  
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
Noman Youaf
Event Management System
All Events:
Event Name: Tech Conference 2025
Event Date: 2025-01-05
Start Time: 09:00 AM
End Time: 5:00 PM
Venue: Malik Hall
-----------------------------------
Event Name: Cultural Festival
Event Date: 2025-01-25
Start Time: 3:00 PM
End Time: 10:00 PM
Venue: Hockey Ground, Main City
-----------------------------------
Event Name: Education Expo
Event Date: 2025-02-05
Start Time: 10:00 AM
End Time: 4:00 PM
Venue: Exam Hall, University
-----------------------------------