Advertisement
Guest User

Untitled

a guest
Nov 20th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. Permanent link:
  2.  
  3.  
  4. Final Model:
  5.  
  6. pred Inv1 {
  7.  
  8. // A phone number cannot belong to two different contacts
  9.  
  10. all disj c1, c2: Contact | no c1.phones & c2.phones
  11.  
  12. }
  13.  
  14. pred Inv2 {
  15.  
  16. // Every called number belongs to a contact
  17.  
  18. all c: Call | c.number in Contact.phones
  19.  
  20. }
  21.  
  22. pred Inv3 {
  23.  
  24. // Simultaneous calls cannot exist
  25.  
  26. no disj c1, c2: Call | c1.time = c2.time
  27.  
  28. }
  29.  
  30.  
  31.  
  32. --------------------------------------------------------------------------
  33.  
  34. Permanent Link:
  35.  
  36.  
  37. Final Model:
  38.  
  39. pred Inv1 {
  40.  
  41. // Each student must be enrolled in at least one course
  42.  
  43. all s: Student | some c: Course | s in c.enrolled
  44.  
  45. }
  46.  
  47. pred Inv2 {
  48.  
  49. // All the members of a team are enrolled in the respective courses
  50.  
  51. teams.members in enrolled
  52.  
  53. }
  54.  
  55. pred Inv3 {
  56.  
  57. // Only enrolled students can have a grade in a course
  58.  
  59. grade.Grade in enrolled
  60.  
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement